Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / desktop

Extend the GNOME 2.x desktop menu

0.00/5 (No votes)
11 Aug 2015CPOL2 min read 6.2K  
How to group applications into user defined menus of the GNOME desktop menu.

Introduction

I'd like to group applications on my open SUSE 11.3 GNOME desktop menu into user defined menus - but i couldn't find a how-to description. I solved this, but it took me 2 hours investigation and i want to share my knowledge now.

I think my procedure to master the challenge can be helpful for other Linux distributions and desktop managers as well.

Background

After installation of some applications for test purpose, i'd like to have them presented in a dedicated desktop menu Software testing.

Image 1

There is a good Desktop Menu Specification article, but translating the information into knowledge has been harder to me than expexted.

Step by step procedere

--> First i had to investigate which of the /etc/xdg/menus/*.menu files define my desktop menu. My desktop menu displays an Application menu and i choosed this menu as object of investigation. With a little try and error through the *.menu files i detected /etc/xdg/menus/applications.menu as responsible for name change from Applications to Applications__ and back.

XML
<!-- ORIGINAL entry -->
<Menu>
    <OnlyUnallocated/>
    <Name>Applications</Name>
    <Directory>suse-applications.directory</Directory>
    <Include>
        <All/>
    </Include>
</Menu>
XML
<!-- ALTERED entry -->
<Menu>
    <OnlyUnallocated/>
    <Name>Applications__</Name>
    <Directory>suse-applications.directory</Directory>
    <Include>
        <All/>
    </Include>
</Menu>

From now on all steps are straight forward.

--> Second a new menu node has to be created and configured for /etc/xdg/menus/applications.menu.

XML
<Menu>
    <NotOnlyUnallocated/>
    <Name>SoftwareTesting</Name>
    <Directory>suse-software-testing.directory</Directory>
    <Include>
        <Category>SoftwareTesting</Category>
    </Include>
</Menu>

The <Directory> sub-node defines the relative path of to the *.directory file, containing meta information about the menu. The <Category> sub-node defines the category, an application must assigned to, to be presented in the menu.

--> Third the /usr/share/desktop-directories/suse-software-testing.directory file has to be created. I based my file on a copy of suse-system.directory, because the suse-system.directory file has been referenced by another menu's <Directory> sub-node, and therefore it must be valid.

[Desktop Entry]
X-SuSE-translate=true
Encoding=UTF-8
Name=Software testing
Icon=package_development

Type=Directory

The Name value defines the display text of my new desktop menu.

--> Fourth the applications have to be assigned to the menu. For this, every menu entry is defined by a /usr/share/applications/*.application file.

[Desktop Entry]
Name=Xfe
Name[cs]=Xfe
Name[de]=Xfe

...

enericName=File Manager
GenericName[cs]=Souborový manažer
GenericName[de]=Dateimanager
...

Comment=A lightweight file manager for X Window
Comment[cs]=Lehký souborový manažer pro X
Comment[de]=Ein leichter Dateimanager für X Window

...

Exec=xfe
Terminal=false
Type=Application
StartupNotify=true
Icon=xfe
Categories=System;FileManager;SoftwareTesting;

Most of the values are self-explanatory. The Categories value assigns the menu categories, the application has to be presented in.

Mind that a menu will be displayed only, if at least one application is assigned to it's category.

Points of Interest

Have fun to personalize your system.

History

Initial version from 11. July 2015.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)