Editar menús do sistema

Pode editar os ficheiros de configuración do menú e ficheiros de datos do menú manualmente para personalizar menús.

2.5.1. Engadir menús

Para engadir un menú para todos os usuarios, realice os seguintes pasos:

  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 Sección 2.4 ― Ficheiros de entrada de cartafol.
  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 Sección 2.2 ― Ficheiros de definición de menú.
  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 Sección 2.5.2 ― 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.

Falta un menú?

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.

2.5.2. Adding an Item to a Menu

Para engadir un elemento a un menú para todos os usuarios, realice os seguintes pasos:

  1. Create a desktop entry file for the item that you want to add. For more information on desktop entry files, see Sección 2.3 ― Ficheiros de entrada de escritorio.
  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.

2.5.3. Editar as propiedades dun menú

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 Sección 2.4 ― Ficheiros de entrada de cartafol.

2.5.4. Editar un elemento de menú

Para editar un elemento de menú, realice os pasos seguintes:

  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 Sección 2.3 ― Ficheiros de entrada de escritorio.

2.5.5. Eliminar un elemento do menú

Para borrar un elemento dun menú para todos os usuarios.

  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.

O elemento do menú non se mostra no menú a próxima vez que os usuarios inicien a súa sesión. O Exemplo 2-2 mostra como se realizou isto no ficheiro applications.menu. A entrada de escritorio para dasher.desktop está especificada excluída do menú de accesibilidade.

Exemplo 2-2Eliminar un elemento do menú
<!-- ... -->

  <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>

<!-- ... -->