Can I hide default actions from Gnome desktop files?

Hi All,

I am working on Ubuntu 20.4 and creating desktop files in /usr/share/applications/
(Desktop Entry Specification)

Everything is working as expected, still I am unhappy about the default actions “New Window” and “Show Details”.

First my application does not allow a second instance, so “New Window” is useless for me.
Second my application has no entry in the Gnome Software Centre, so again useless for me.

I now know how to add new actions, but it seems there is no way to hide those default actions? Am I missing something?

Regards

First my application does not allow a second instance, so “New Window” is useless for me.

You can add

SingleMainWindow=true

in you .desktop file if the heuristics to detect the capability automatically fail.

That (standardized) key has been supported since GNOME 40, if you want to support older versions, you can add X-GNOME-SingleWindow=true as well.

Second my application has no entry in the Gnome Software Centre, so again useless for me.

Nothing you can do there (short of uninstalling gnome-software), sorry.

Oh - I did miss this key - it’s in the spec. Sorry for the noise and thank you for pointing this out!

Regards

You’re welcome.

It’s a fairly recent addition to the spec, so easy to miss.