List all desktop files that appears in application menu

applications-databasedesktopgnomemenu

Context

I'm using GNOME 3.22 and I want to organize all desktop files in groups. To do so, I must list all desktop files that appears in the application menu and use some command from this guide to organize them.

I've discovered that there're 3 places that contain these desktop files:

~/.local/share/applications
~/.local/share/flatpak/exports/share/applications
/usr/share/applications

Using this script, I half-succeed. However, there're still some items that doesn't belongs to any group:

  • These desktop files don't have any Categories field so I cannot rule over them by category

  • These desktop files don't belong to any directory I listed above so I cannot call their names

Question

Apparently, GNOME doesn't list desktop files just from directories above. There must be some place that store them, the desktop shell just need to read it to list all applications. I just cannot see it. Could you please let me know where is it?

Update

This is my "half-success":
GNOME Apps Menu

Best Answer

This link may help with desktop files that don't have any "Category" field: https://wiki.gentoo.org/wiki/Gnome_Applications_Folders

Related Question