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.
just FYI, you're running an End-of-Life'd ubuntu release: https://lists.ubuntu.com/archives/ubuntu-announce/2012-October/000165.html: Please consider upgrading to a newer version.
– Carlos Campderrós – 2012-11-20T10:43:46.653