How to show in menu apps of different desktop environments?

I suspect the key lies in the content of .desktop files most commonly found in /usr/share/applications. (A user may also have some .desktop files placed in $HOME/.local/share/applications automatically or manually.)

The format of .desktop files is usually based on specifications laid down by freedesktop.org.

Of interest here, are two entries:

NoDisplay

means "this application exists, but don't display it in the menus". This can be useful to e.g. associate this application with MIME types, so that it gets launched from a file manager (or other apps), without having a menu entry for it (there are tons of good reasons for this, including e.g. the netscape -remote, or kfmclient openURL kind of stuff).

OnlyShowIn, NotShowIn

A list of strings identifying the desktop environments that should display/not display a given desktop entry.

By default, a desktop file should be shown, unless an OnlyShowIn key is present, in which case, the default is for the file not to be shown.

On my system which is just "KDE", I see:

$ grep -E "NoDisplay"  /usr/share/applications/*.desktop         
/usr/share/applications/display-im6.desktop:NoDisplay=true
/usr/share/applications/display-im6.q16.desktop:NoDisplay=true
/usr/share/applications/geoclue-where-am-i.desktop:NoDisplay=true
/usr/share/applications/hplj1020.desktop:NoDisplay=true
/usr/share/applications/ktelnetservice5.desktop:NoDisplay=true
/usr/share/applications/kwalletmanager5-kwalletd.desktop:NoDisplay=true
/usr/share/applications/libreoffice-math.desktop:NoDisplay=false
/usr/share/applications/libreoffice-startcenter.desktop:NoDisplay=false
/usr/share/applications/libreoffice-xsltfilter.desktop:NoDisplay=true
(plus many more entries)


$ grep -E "OnlyShowIn"  /usr/share/applications/*.desktop
/usr/share/applications/org.kde.kcolorschemeeditor.desktop:OnlyShowIn=KDE;
/usr/share/applications/org.kde.kinfocenter.desktop:OnlyShowIn=KDE;
/usr/share/applications/org.kde.kmenuedit.desktop:OnlyShowIn=KDE;
/usr/share/applications/org.kde.plasmashell.desktop:OnlyShowIn=KDE;
/usr/share/applications/org.kde.polkit-kde-authentication-agent-1.desktop:OnlyShowIn=KDE;
/usr/share/applications/systemsettings.desktop:OnlyShowIn=KDE;
$ 

$ grep -E "NotShowIn"  /usr/share/applications/*.desktop
/usr/share/applications/kdesystemsettings.desktop:NotShowIn=KDE;
/usr/share/applications/libreoffice-math.desktop:NotShowIn=GNOME;
/usr/share/applications/libreoffice-startcenter.desktop:NotShowIn=GNOME;
/usr/share/applications/org.kde.kdeconnect.kcm.desktop:NotShowIn=KDE;
/usr/share/applications/org.kde.kdeconnect.nonplasma.desktop:NotShowIn=KDE;
/usr/share/applications/org.kde.klipper.desktop:NotShowIn=KDE;
/usr/share/applications/system-config-printer.desktop:NotShowIn=KDE;GNOME;
$ 

As you'll gather for yourself if you run the commands given above on your system, there may be good reason for some applications not being included in menus, either of the original desktop environment or in any other. In some cases, there may not be a reason that you feel is valid.

If you do want to change the status of display for certain applications, I suggest you copy the corresponding .desktop file over to ~/.local/share/applications and make your changes there. Changes made there will

  • not need sudo
  • be only for you and not for other users
  • be unchanged if/when the application is updated whereas the .desktop file in /usr/share/applications will be overwritten.

You can use alacarte to edit the app menu. It's not like making every shortcut from scratch, neither is it automated...

In some versions of alacarte, software from other desktop environments are also shown...