Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone provide a reference or explain how the icons to the alt-tab list is populated? I would like to specify some icons for some programs that do not have icons, e.g. xterm. I'm using Ubuntu 11.04 with Gnome 2 (Ubuntu Classic) and metacity as the window manager.

I did see this thread that mentions /usr/share/pixmap/, but if I use cp gnome-terminal.xpm xterm.xpm the icon was not populated in the alt-tab icon list (even after a logout/login). I do see that the icon is populated when I added the xterm command to the Program Menu.

share|improve this question
    
just FYI, you're running an End-of-Life'd ubuntu release: lists.ubuntu.com/archives/ubuntu-announce/2012-October/…: Please consider upgrading to a newer version. – Carlos Campderrós Nov 20 '12 at 10:43

The window manager probably obtains this information from .desktop files. (I can confirm with GNOME 3 Shell, but should be the same in Metacity.)

These days every graphical program installs a file or several to /usr/share/applications (you can add your own to ~/.local/share/applications). It's an INI-format file containing the basic information about that program according to Desktop Entry Specification: name, primary executable, icon, ... For running programs, the window manager matches the window owner to the program named in Exec= line.

(When you add items to the GNOME menu, they are automatically stored in .desktop files.)

For example, I have written the following as ~/.local/share/applications/xterm.desktop to make my Xterm have a generic "terminal" icon:

[Desktop Entry]
Name=XTerm
Comment=Use the command line
Exec=xterm
Icon=utilities-terminal
Type=Application
Categories=Utility;TerminalEmulator;

The Icon key may be an absolute path to an image, or an icon name according to Icon Theme Spec. The system comes with /usr/share/icons, and you can put your own to ~/.local/share/icons. (If it doesn't exactly match the naming spec, hicolor/256x256/program.png will be fine.)

Note that the preferred format is PNG, which has more capabilities than XPM.

share|improve this answer
    
Thanks for your response. I tried creating the .desktop files, and placed my icons in ~/.local/share/icons. This indeed influences the icons the application menu ("Windows start" button). However, the icons in the alt-tab list still does not change. Any other suggestions? – Vinh Nguyen Sep 9 '11 at 17:46
    
Confirmed this is the case in both cases where the files are placed in the /usr/share and ~/.local/share. – Vinh Nguyen Sep 9 '11 at 17:56
    
@Vinh: Even after restarting Metacity? – grawity Sep 9 '11 at 18:25
    
I restarted after every change (don't know how to restart Metacity itself). – Vinh Nguyen Sep 9 '11 at 19:22
    
any more thoughts??? – Vinh Nguyen Sep 10 '11 at 15:33

The name of the executable whose icon you want to have appear in the alt-tab listing and the name of the file in /home/assure/.local/share/applications must be the same in order for this to work.

share|improve this answer
    
I have the following: $ cat .local/share/applications/xterm.desktop [Desktop Entry] Name=XTerm Comment=Use the command line Exec=xterm Icon=utilities-terminal Type=Application Categories=Utility;TerminalEmulator; Can you give an example for xterm? – Vinh Nguyen Nov 21 '12 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .