"NoDisplay=True" Not Hiding App

For some of my work websites, I need to use Edge and have the developer variety installed on my vanilla F43 system. After a recent update, I started seeing two icons in the GNOME Shell launcher and discovered there are two entries in /usr/share/applications; that is, I have a microsoft-edge-dev.desktop file and a com.microsoft.Edge.dev.desktop file.

The only difference in the two files is the following lines at the end of the com.microsoft.Edge.dev.desktop file:

# This is the same as microsoft-edge-dev.desktop except NoDisplay=true prevents
# duplicate menu entries. This is required to match the application ID
# used by XDG desktop portal, which has stricter naming requirements.
# The old desktop file is kept to preserve default browser settings.
NoDisplay=true

According to that note, the No-Display=true comment should make only one of the app icons show up in GNOME Shell overview; however, I have two.

Any ideas?

1 Like

It should work, that’s the right entry:

I checked and I have lots of files that use NoDisplay=true, and they’re not listed in the Activities menu (dont’ seem to be, I haven’t checked them all).

No chance you also have similar files in ~/.local/share/applications?

That’s what I thought…

Good idea to have me check ~/.local/share/applications, but there’s nothing in there related to Edge.

1 Like

The nuclear test would be to remove the file completely, and see if that limits to only one icon XD

I did that previously and it did, but Edge updated the other day and it came back. It sounds like one “solution” is to just delete one of them each time Edge updates, but that’s not really a solution.

1 Like

Yeh, that’s not a solution at all. Could you share both the desktop files to we can have a look?

Are both icons always shown, or does a new one pop up when you run Edge? I.e., there’s only one with Edge is not running, but running it pops up a new one?

Upload both files or run diff and post the results?

1 Like

Could upload both here if theyre not too big i reckon?

sed -e '/^NoDisplay=/d' \
    /usr/share/applications/com.microsoft.Edge.dev.desktop \
    > /tmp/com.microsoft.Edge.dev.desktop
desktop-file-install \
    --dir=${HOME}/.local/share/applications \
    --set-key=NoDisplay \
    --set-value=true \
    /tmp/com.microsoft.Edge.dev.desktop
1 Like

I don’t think that’ll work well, since both are over 200 lines.

Sorry, @vgaetera, but I’m not sure what you’re suggesting…

It’s in the wrong section, so it fails, see:

desktop-file-validate /usr/share/applications/com.microsoft.Edge.dev.desktop

The above post should correct the syntax.

1 Like

Never knew about that tool; interestingly it doesn’t like my quote style :stuck_out_tongue: (been working fine cross-OSs years):

/home/espionage724/.local/share/applications/wine/Programs/Guild Wars 2/Guild Wars 2.desktop: error: value "'/bin/bash' -c "gio open ~/'Documents/Guild Wars 2/Screens'"" for key "Exec" in group "Desktop Action Screenshots" contains a reserved character ''' outside of a quote

No-Display=true had:

Guild Wars 2.desktop: error: file contains key "No-Display" in group "Desktop Entry", but keys extending the format should start with "X-"

X-No-Display=true didn’t show an error on desktop-file-validate but didn’t hide the launcher on Xfce. NoDisplay=true (no dash) works no-error and hides the launcher!

Thanks for that explanation and it led to more questions… My Edge’s desktop file isn’t in ~/.local/share/applications but your script seems to put it there. Also, I always thought (perhaps wrongly) that the “X” preceeding something referred to X11; no?

Maybe one last piece, why would Microsoft install two .desktop files in the first place?

This helps the workaround to survive package updates.

Extending the format | Desktop Entry Specification

That must be for backward compatibility, otherwise there’s no need to keep the old file.

1 Like

You could duplicate the desktop file to your /usr/local/share location and then edit it to be hidden:

$ sudo cp /usr/share/applications/com.microsoft.Edge.dev.desktop /usr/local/share/applications/
$ sudo sed -i "2a\\NotShowIn=GNOME;KDE" /usr/local/share/applications/com.microsoft.Edge.dev.desktop
$ sudo update-desktop-database /usr/local/share/applications/
2 Likes