JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Desktop Administrator's Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information


1.  Administering the Oracle Solaris Desktop

2.  Managing User Preferences With GConf

3.  Customizing Menus

Menus Overview

Working With Menu Definition Files

Working With Directory Entry Files

Working With Desktop Entry Files

Editing Menus

Adding and Modifying System Menus

How to Add a Menu

How to Add an Item to a Menu

How to Edit the Properties of a Menu

How to Edit a Menu Item

How to Delete an Item From a Menu

Creating and Modifying User Menus

Merging Menus

Merging User and System Menus

4.  Installing Themes

5.  Customizing Fonts

6.  Working With MIME Types

7.  Managing Screensavers

8.  Managing Sessions

9.  Overview of the Yelp Help Browser

10.  Improving the Performance of the Oracle Solaris Desktop System

11.  Disabling Features in the Oracle Solaris Desktop System

12.  Working With the X Window System

A.  Hidden Directories



Merging Menus

By default, user menu configuration files take precedence over system menu configuration files of the same name. For example, if an file is present in the user's $XDG_CONFIG_HOME/menus directory, then that file will be used instead of the system file to configure the Applications menu for that user. This replacement might result in the user not having access to all the menu items they would expect. To avoid this situation, a menu configuration file can specify that it should be merged with other menu configuration files, rather than replacing them. This process is described in the following sections.

Merging User and System Menus

Often, a user only wants to add or delete menu items in addition to the standard system menu. To support these changes, you should use the <MergeFile> element with the attribute type="parent" within the user's file.

The <MergeFile> element enables a menu to be merged with the contents of the user's menu file. When you specify the element's type attribute as “parent”, the contents of the <MergeFile> element are ignored. The next file in the $XDG_CONFIG_DIRS/menus directory is used for merging.

Note - Older specifications did not include the type attribute and simply require the location of the menu file to be merged as the content of the <MergeFile> element. As a result, you might still see a location specified in the contents of <MergeFile>, even when type="parent".

The menu merging is performed as follows:

  1. The children of the root <Menu> element in the merged menu file are substituted for the <MergeFile> element in the base menu file.

    Note - “Merged menu file” refers to the next in the $XDG_CONFIG_DIRS/menus directory.

  2. All child <Menu> elements with the same name are consolidated into a single <Menu> element by appending all child elements of each <Menu> element with the same name into the last occurrence of the menu element.

The following example shows a user menu file explicitly merging the system menu file.

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"

    <MergeFile type="parent">/etc/xdg/menus/</MergeFile>