[Solved] Mapping between categories in .desktop files and the applications menu

I believe most DEs read the .desktop files in /usr/share/applications when populating their applications menus, so I assume this question is common for most DEs.

The applications .desktop files contains a field named "Categories", but this field doesn't seem to be used in the placement of the applications in the application menus in the DEs?

I have 105 application categories as per the Categories entries in the .desktop files, but my unmodified XFCE application menu contains only 10 categories.

I can find most of my application menu categories among the .desktop file categories, but "Accessories" and "Multimedia" does not exist as categories in any .desktop file, and "Games" exist only as "Game" in the .desktop files.

So, I it seems one of the following two situations must be true:

  1. The "Categories" entry from the .desktop files are not used for application menu placement
  2. The .desktop files are used, but some sort of filtering or mapping takes place

Correspondingly, my question is:

  • If 1 is true: Where would I find the application menu placement configuration?
  • Or, if 2 is true: Where would I find the filtering or mapping configuration?

I think this is how it works, although I'm not very familiar with the underlying mechanism.

For more information, you can have a look at these specifications:


If you want to change the category that a specific .desktop files appears in, I think that the easiest way to do it is by copying the .desktop file in ~/.local/share/applications/ and editing the Categories entry based on the information provided in the above linked pages.

1 Like

As @bill_t already explained, the Desktop Menu Specification and Desktop Entry Specification define some default categories.

https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry

However every program that implements these specifications can uses own names to make it more human understandable and provide a localisation in different languages.

On XFCE most applications and plugins that show categorizes use garcon in the background.
https://git.xfce.org/xfce/garcon/

The Game - Games example is defined in xfce-applications.menu line 90.

Other DEs or implementations can name it differently.

2 Likes

Many thanks, both @bill_t and @xabbu - the menu specifications and file locations described in https://specifications.freedesktop.org/menu-spec/latest/ explains it beautifully.

And thanks for that info on garcon @xabbu - that seems to be XFCE-specific.

I have something to read now :slight_smile:

1 Like

Forum kindly sponsored by