-   Linux - Newbie (
-   -   Specify an application's alt-tab icon (

anonguy9 03-26-2009 12:12 PM

Specify an application's alt-tab icon
I'm on PCLinuxOS, using Openbox.

When I have an xterm, and I alt-tab to see my list of icons, xterm has a boring icon. Some other programs are also boring, but not all. Firefox, for example, has a nice icon. How do I specify an icon for an un-iconed app, or change an icon for an existing one?

I've done some hunting around on my system and I've done some searching. I'm seeing all kinds of stuff and nothing seems to be quite right, so I need some help.

I'd prefer commandline instructions, but if there's a GUI tool I ought to know about, then give me its commandline name.

Simon Bridge 03-27-2009 09:01 PM

IIRC: The alt-tab icons use the set assigned to the application by the icon theme.

anonguy9 03-27-2009 11:26 PM

Ok. I'll start with .. what's an icon theme? Isn't that a KDE thing?

I do notice some directories and files associated with KDE and its icons. I remember stomping around there, but I'm not sure where the main configuration files are, and how I could modify whatever's being used right now.

I checked some apps, and there are two with icons.
- leafpad
- firefox

Based on this, I looked in /usr to see if there was a theme directory which had both a leafpad image and a firefox image. I came up dry. I do seem to have multiple themes there, but I'm not sure how to tell what I'm using (if any).

I also did some more googling with "icon theme" and some other search terms, and didn't get anything definitive. There are some documents out there on openbox-related stuff, but none of those seem to be correct for what I'm trying to do.

Simon Bridge 03-28-2009 12:53 AM
... there's an art to searching with google - for the above I searched:

openbox icon theme pclinuxos


The gtk themes work nicely, as do the icons, once you figure out how to make openbox access them. To access your icons you create a file called .gtkrc.mine in your home directory and add your icons in this format
gtk-icon-theme-name = "name"

Where "name" is my choice for the icon theme. You can see what icon themes you have installed in /usr/share/icons. Simply substitute for your preferred icon theme. Then you log out of openbox and back in and your icons will have been changed!

Obconf handles themes, and you can install new themes into /usr/share/themes for Obconf to easily find.
Of course - if it's just one or two apps you want to change - you can edit the icons directly. Just hunt for all the icons for that app (most will be links) and substitute the image, in appropriate format, that you'd prefer.

anonguy9 03-29-2009 03:57 AM

Aha, thanks Simon.

Strange, I didn't think to search from that angle. I thought that icons were a generic system-wide Linux/X11 type thing.

I did read a bit on gtk themes while researching, but when I went looking on my system I didn't seem to find anything related to it, so I thought it didn't apply to me.

I guess I was wrong on both counts.

I'll definitely look into this. I don't just want to change a few icons, because there seems to be a default icon shared with many applications. I just want to specify an icon for one or two of my common and icon-absent apps.

anonguy9 03-29-2009 12:58 PM

Thanks for the leads, but no luck so far.

Sorry for the long post.. I'm keeping track of everything I've done so I don't backtrack and repeat myself.

Manage themes with obconf.

Specify your own custom one in ~/.gtkrc.mine


gtk-icon-theme-name = "nuoveXT-aero"
By default, themes are found in /usr/share/icons, e.g. /usr/share/icons/nuoveXT-aero/

helper script idea:



for i in `find $ICONDIR -maxdepth 1 -type d`;do
  if [ "$i" = "$ICONDIR"/"$MYTHEME" ]; then success=yes ; fi
if [ "$success" = "no" ]; then
  echo fail!
elif [ "$success" = "yes" ]; then
  echo "[ok] - $ICONDIR/$MYTHEME"
  echo gtk-icon-theme-name = \""$MYTHEME"\" > ~/.gtkrc.mine
  echo BAD BUG 1

BUT, openbox actually uses the themes in /usr/share/themes, e.g. my current /usr/share/themes/minimal/openbox-3/themerc

However, I see other themes like /usr/share/themes/Wonderland/gtk-2.0/gtkrc

By the way: "export|grep gtk" gives me nothing.

Someone else said to edit /home/user/.gtkrc-2.0-kde with:


To force a test, I tried:


echo gtk-icon-theme-name = \"nuoveXT-aero\" > ~/.gtkrc.mine
 cd /usr/share/icons/nuoveXT-aero/22x22/apps/
 mv firefox.png firefox.png-
 mv firefox-icon.png firefox-icon.png-
 # And to avoid Firefox falling back on a default, I tried:
 cp web-browser.png firefox.png
 mv web-browser.png firefox-icon.png

No luck. This theme isn't being used. I configured openbox largely by hand, and so I have this:


It references my minimal theme, so maybe I should just copy the structure from somewhere else and give minimal some icons. Then maybe I can hijack the firefox icon.


 cd /usr/share/icons/nuoveXT-aero/
 cp -a nuoveXT-aero minimal
 cd minimal/22x22/apps/
 mv firefox.png firefox.png-
 mv firefox-icon.png firefox-icon.png-
 cp web-browser.png firefox.png
 mv web-browser.png firefox-icon.png

No joy. It looks like ~/.gtkrc.mine is not being used to set the theme, because obconf is still set on minimal. So let's try modifying minimal. I looked, and /usr/share/icons/minimal/index.theme says that the toolbar default is 24, so I tried correcting that:


cd /usr/share/icons/minimal/24x24/apps/
 mv firefox.png firefox.png-
 mv firefox-icon.png firefox-icon.png-
 cp web-browser.png firefox.png
 mv web-browser.png firefox-icon.png

No joy. Now let's assume that the icons are being scaled from elsewhere. So I'll try deleting all but the largest icons.


 cd /usr/share/icons/minimal/
 # WARNING: rm -rf AS ROOT, so don't screw up this command!
 find -maxdepth 1 -type d \
 ! -name extra \
 ! -name . \
 ! -name 128x128 \
 -exec rm -rf {} \;

 cd 128x128/apps/
 mv firefox.png firefox.png-
 mv firefox-icon.png firefox-icon.png-
 cp web-browser.png firefox.png
 mv web-browser.png firefox-icon.png

No luck. I know that /usr/share/themes/minimal is being used, and I want it to continue to be used, but it feels like all these icons are not coming from /usr/share/icons/minimal/

I checked for an icon default. I see /usr/share/icons/default has only index.theme but inside it only has

# [Icon Theme]
# Inherits=whiteglass

Since everything is commented out

I did not edit /usr/share/icons/minimal/index.theme and so it's just a copy from the other theme, so it would be a bit incorrect inside.

Btw, I also looked at every icon in /usr/share/icons/nuoveXT-aero/24x24/ and I could not find the icon being used for the applications which I want to update. So something's definitely awry.

I'm out of ideas. I'll continue to read through a couple of threads I found. Maybe I'll find something new to try.

I'm also going to check specifically for more skinning/style/theme info for openbox. Maybe there will be some insight there.

Simon Bridge 03-29-2009 11:14 PM

openbox actually uses the themes in /usr/share/themes, e.g. my current /usr/share/themes/minimal/openbox-3/themer

... while you are learning, use the themes in /usr/share/themes.
Unfortunately I do not have an installation of open box to compare with.
Check that the icons you replace are the actual files and not links.
IIRC: changing the firefox icon is a little different to others - try a different application for your test.

For me:
$ export | grep gtk
declare -x GTK_RC_FILES="/etc/gtk/gtkrc:/home/simon/.gtkrc-1.2-gnome2"

... do you understand why this step was important?

All times are GMT -5. The time now is 09:02 AM.