|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris 11.1 Desktop Administrator's Guide Oracle Solaris 11.1 Information Library|
Menu files define the hierarchy of menus that are used in the Oracle Solaris Desktop menu bar. By modifying these files, you can customize menus for all users or for a single user depending on the location of the applications.menu file that you modify.
Menu files must reside in the $XDG_CONFIG_DIRS/menus/applications.menu directory. To work with menu files, you must set the $XDG_CONFIG_DIRS environment variable, defined in the XDG base directory specification.
To resolve the location of the applications.menu file, the system searches the default path in the following order:
Searches each directory in the $XDG_CONFIG_HOME path to find the menus/applications.menu file. If the $XDG_CONFIG_HOME environment variable is not set, the search defaults to the ~/.config/ directory.
Searches each directory in the $XDG_CONFIG_DIRS path to find the menus/applications.menu file. If the $XDG_CONFIG_DIRS environment variable is not set, the search defaults to the /etc/xdg/ directory.
Uses the first applications.menu file found.
The following example shows a sample .menu file:
Example 3-1 Example of a .menu File
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"> <Menu> <Name>Applications</Name> <Directory>Applications.directory</Directory> <!-- Read standard .directory and .desktop file locations --> <DefaultAppDirs/> <DefaultDirectoryDirs/> <!-- Accessories submenu --> <Menu> <Name>Accessories</Name> <Directory>Accessories.directory</Directory> <Include> <And> <Category>Utility</Category> <Not> <Category>System</Category> </Not> </And> </Include> </Menu> <!-- End Accessories --> <!-- possibly more submenus --> </Menu> <!-- End Applications -->
In this example, the top level menu is named Applications, which is specified using the <Name> element. The Applications menu contains a single submenu, but several submenus are allowed. Each submenu can also have an <Include> element to perform a filter on the set of available desktop entries using matching rules.
For example, the <Category> element is a basic matching rule that selects a desktop entry file only if the Categories key contains the content of the <Category> element. In the example, the Accessories menu will include a desktop entry only if the menu contains the word “Utility” but not “System” in the Categories key. For more information about the Categories key, see Working With Desktop Entry Files.
The following table describes some of the elements in .menu files.
Table 3-1 Menu Definition File Elements
For a detailed description of the elements in the .menu files, see the XDG menu specification.