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:

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.