Oracle® Solaris 11.2 Desktop Administrator's Guide

Exit Print View

Updated: July 2014
 
 

Merging User and System Menu s

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 applications.menu 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. T he next applications.menu 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 applications.menu 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"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">

<Menu>
	<Name>Applications</Name>
	<MergeFile type="parent">/etc/xdg/menus/applications.menu</MergeFile>
 <Menu>
	<Name>Accessibility</Name>
	<Exclude>
   <Filename>dasher.desktop</Filename>
	</Exclude>
 </Menu>
</Menu>