Wednesday, April 15, 2009

Gnome: Add menu item

To add a gnome application menu item or so-called "Desktop Entry" the following procedure can be used (I did it in CentOS5.2). Lets assume that we want to add menu item for Octave. First, as a root create file octave.desktop in /usr/share/applications/ with the following contents:[Desktop Entry]
Name=Octave 3
Comment=Octave instead of Matlab
Categories=Application;
Exec=octave
Terminal=true
Type=Application
Icon=octave.png
Encoding=UTF-8
StartupNotify=true
octave.png icon can be created manually. Just find some octave logo imagee, convert it to png of size of 48x48 pixels and place it in folder /usr/share/pixmaps/. Of course it is not necessary, if icon does not exist gnome will not display any icon, only Name.The advantage of this procedure is that menu entry created will be available for every user, not only for root.

1 comment: