Not for the first time, I recently wondered how to add icons for applications which are missing one on my debian testing. I did this for XFCE, but I guess this is in no way depending on the DE used. Consider for example the case of FCEUX, which is an emulator for Nintendo Entertainment System (NES), Famicom (aka Super NES) and Famicom Disk System (FDS). I can install this fine via apt-get, but I do not get an icon in the menu:

No menu icon for FCEUX in XFCE's start menu

Looking at the .desktop file for FCEUX, which can be found in /usr/share/applications/fceux.desktop, shows that an icon is specified (shown in bold):


[Desktop Entry]
Type=Application
Version=1.0
Name=Fceux
GenericName=NES/Famicom emulator
NoDisplay=false
Comment=Emulate NES ROMs
Exec=/usr/games/fceux
Icon=/usr/share/pixmaps/fceux.png
Terminal=false
MimeType=application/x-nes-rom
Categories=Game;Emulator;
Encoding=UTF-8
Actions=Fullscreen;DefaultConfig;

The simplest way to resolve this is to add the icon to the icon set you use, update the icon set’s cache and just specify it with a relative path without file ending. So change the path in the .desktop file to be Icon=fceux, and add the file, maybe converted to the appropriate sizes, to your icon set. I use the hicolor icon theme, which is located in /usr/share/icons/hicolor, so that means I’ll do something like this:


sudo convert -resize 16x16 /usr/share/pixmaps/fceux.png /usr/share/icons/hicolor/16x16/apps/fceux.png

You can do this for other sizes as well, once you are done, run sudo gtk-update-icon-cache /usr/share/icons/hicolor to update the icon cache and you’re done:

Menu icon for FCEUX in XFCE's start menu

There may be deeper issues here, for example why the image is not shown when given as an absolute path to /usr/share/pixmaps/fceux.png, but anyway, this helps and can be used even if no image file comes with the application and you have to get one yourself or if you do not get a package like when installing a recent eclipse etc.