Chapter 3. Menu Editing and Configuration

NoteTip
 

For detailed information describing the implementation of the menu system, refer to the Desktop Menu Specification located at the freedesktop.org website: http://standards.freedesktop.org/menu-spec/latest.

It is often useful for an administrator to add or remove items from the main desktop Applications menu. Owing to the complexity of the menu system, modifying the Applications menu can sometimes be a difficult task. For example, it is much more difficult to add a menu item than it is to remove a menu item.

This chapter provides an overview of the menu system and documents methods for:

3.1. Overview of the Menu System

NoteNote
 

This overview of the menu system is not intended to to be comprehensive in its scope. For detailed information about the menu system, refer to the various menu-related specifications at the freedesktop.org web site: http://www.freedesktop.org

The Red Hat menu system is based on the the freedesktop.org Desktop Menu Specification and consists of three major sets of configuration and data files:

Menu (*.menu) Files

The *.menu files are XML configuration files that specify the order, hierarchy, and merging of both menus and menu items.

The system *.menu files are located in /etc/xdg/menus/. User-specific *.menu files are located in $HOME/.config/menus/ and can be edited to override the values specified in the system *.menu files.

In particular, the /etc/xdg/menus/applications.menu file contains the definition of the main application menu layout.

Directory Entry (*.directory) Files

The *.directory files provide data about a menu such as its name, tooltip, and icon, and are located in /usr/share/desktop-directories/. Refer to the GNOME Desktop System Administration Guide for more information on directory entry files.

Desktop Entry (*.desktop) Files

The *.desktop files provide data about a menu item such as its name, command to run, and its icon. The desktop entry files also contain keywords that determine the location of the menu item in the menu hierarchy. The system desktop entry files are located in /usr/share/applications/. Refer to the GNOME Desktop System Administration Guide for more information on desktop entry files.

User-specific desktop entry files are located in $HOME/.local/share/applications/ and can be used to add applications to the "Open With =>" submenu that appears when right-clicking on a file. The $HOME/.local/share/applications/mimeinfo.cache contains MIME type information associating the $HOME/.local/share/applications/*.desktop applications with the file types specified in the *.desktop files.