Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

Editing System Menus

You can edit menu configuration files and menu data files manually to customize menus.

Adding Menus

To add a menu for all users, perform the following steps:

  1. Create a directory entry file for the item that you want to add. Place the directory entry file in the $XDG_DATA_DIRS/desktop-directories directory. For more information on directory entry files, see the section called “Directory Entry Files”.

  2. Locate the $XDG_CONFIG_DIRS/menus/applications.menu file.

  3. In the .menu file, add a <Menu> element for the new menu. For more information on .menu files, see the section called “Menu Definition Files”.

  4. Create a <Name> element below <Menu>. The content of the element should contain the name for the menu.

  5. Create a <Directory> element below <Menu>. The content of the element should contain the name of the directory entry file.

  6. See the section called “Adding an Item to a Menu” for how to add an item to the menu.

The next time that users log in, the menu should appear in the menu bar.

Missing Menu?

If you did not specify any matching rules in the <Include> element, or if the rule did not match any desktop entries, then you may not see the menu in the menu bar.

Adding an Item to a Menu

To add an item to a menu for all users, perform the following steps:

  1. Create a desktop entry file for the item that you want to add. For more information on desktop entry files, see the section called “Desktop Entry Files”.

  2. Place the desktop entry file in the $XDG_DATA_DIRS/applications folder.

  3. Locate the $XDG_CONFIG_DIRS/menus/applications.menu file.

  4. Verify that a <Menu> element contains an <Include> element with a matching rule that selects the desktop entry file made in step 1.

The next time that users log in, the menu item is in the assigned location.

Editing the Properties of a Menu

To edit the properties of a menu for all users, perform the following steps:

  1. Locate the $XDG_CONFIG_DIRS/menus/applications.menu file.

  2. Find the <Menu> entry in this file that corresponds to the menu you want to modify. Note the filename of the directory entry in the <Directory> element.

  3. Locate the directory entry for this menu. Modify the contents to change the properties of the menu. For more information on .directory files, see the section called “Directory Entry Files”.

Editing a Menu Item

To edit a menu item, perform the following steps:

  1. Locate the desktop entry in the $XDG_DATA_DIRS/applications directory that corresponds to the menu item.

  2. Edit the desktop entry to change the properties of the menu item. For more information on desktop entry files, see the section called “Desktop Entry Files”.

Deleting an Item from a Menu

To delete an item from a menu for all users:

  1. Locate the $XDG_CONFIG_DIRS/menus/applications.menu file.

  2. Find the <Menu> element in this file that contains the desktop entry you want to delete.

  3. Insert an <Exclude> element after the closing tag for the <Include> element. Make sure this is in the <Menu> element determined in step 2.

  4. Insert the <Filename> matching rule as a subelement of <Exclude> to specifically exclude a desktop entry.

The next time that users log in, the menu item is not displayed in the menu. Example 2.2, “Deleting an Item from a Menu” shows how this done in the applications.menu file. The desktop entry for dasher.desktop is explicitly excluded from showing up in the accessibility menu.

Example 2.2. Deleting an Item from a Menu

<!-- ... -->

  <Menu>
    <Name>Accessibility</Name>
    <Directory>Accessibility.directory</Directory>
    <Include>
      <And>
        <Category>Accessibility</Category>
        <Not><Category>Settings</Category></Not>
      </And>
    </Include>
    <Exclude>
      <Filename>dasher.desktop</Filename>
    </Exclude>
  </Menu>

<!-- ... -->

Previous
Directory Entry Files
GNOME 2.14 Desktop System Administration Guide Next
Editing User Menus and Menu Merging

 
 
  Published under the terms of the GNU General Public License Design by Interspire