Adding your own Gnome menu files.
Menus in Fedora core 6
The menu editor caller alacarte is now installed by default (or get it using yum install alacarte) in FC6 so editing menus is as easy as Start menu > System > Preferences > More Preferences > Menu Layout or run the command 'alacarte' from a command line.
Even knowing the easy way it's still useful to know where the config files are located and how the menus work, in this respect the information below still applies to Fedora Core 6.
Menus in Fedora core 5
Most rpm's will add their own entries to your menus and in Fedora core 5 there is now built in support for controlling which menu entries you see (by right clicking on the main menu icon). However there is no easy way to add or edit the menus, but it's vey easy to do by just creating some small text files and putting them in the right place.
If want want to see the existing menu files you need to navigate to the folder /usr/share/applications/, this contains all the files for the menu. Note that they are hidden files and all have the extension .desktop, just open a file and study the contents to get a better idea.
As an example I choose to install Firefox and Thunderbird using the tar.gz packages straight from the Mozilla site but doing this does not create any menu entries so I just make my own.
First open up your text editor, I use vi but gedit or any other is fine, and put the following lines into the file:
[Desktop Entry] Encoding=UTF-8 Categories=Application;Network;X-Red-Hat-Base; Name=Firefox Comment=Browse the web Exec=firefox Icon=/usr/lib/firefox/icons/mozicon50.xpm StartupNotify=true Terminal=false Type=Application
The important entries are:
- Categories - this will decide under which menu the new entry appears. The best bet is to look in the files you already have and copy the entry. For example if you look at Yumex that has a menu entry under System tools, it's category is listed as Application;System;X-Red-Hat-Base;X-Fedora; in the fedora-yumex.desktop file. So I would just use the same if I wanted my custom icon to appear in the System tools menu.
- Name - this will appear as the menu name and as a tooltip in panel icons.
- Comment - this will also appear as a tooltip on panel icons.
- Exec - this is the actual program to run on clicking the icon. For Firefox, this exists in my $PATH variable so just typing Firefox launches /usr/lib/firefox but I could have written that instead.
- Icon - this is the location of the image to display for the icon, if you use no path then the default is to look in /usr/share/pixmaps/ where most of the application icons reside. In the case of Firefox I've written the full path to the icons folder in my Firefox install folder.
If you opened the text editor as root you can save the file to your /usr/share/applications/ folder giving it any name you wish but with the extension .desktop. If not then save the file to your home folder as somename.desktop then open a terminal and, as root, move the file to this folder:
$ sudo mv firefox.desktop /usr/share/applications/
The Gnome menus are refreshed every time you open them so there's no need to restart the panel to see your new icon, just open the menu to view.
If you wish to hide a menu entry without deleting the .desktop file just add the line
Hidden=true
somewhere in your file, this menu will now be hidden, to unhide just change true to false or delete the line again.


