Desktop file

I am trying to get my snap to shows in the launcher/apps list

I created a desktop file as follows:

 [Desktop Entry]

and in my snapcraft.yaml I added the desktop: property

    command: bin/desktop-launch $SNAP/PocSharpGui
    desktop: poc-sharp.desktop
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - unity7
      - gsettings
      - network

The snap installs without error and I can see the desktop file in /snap/poc-sharp/current

But it still doesn’t appear.

If everything is working, snapd should have installed a processed version of the desktop file to /var/lib/snapd/desktop/applications/poc-sharp_poc-sharp.desktop.

If this desktop file exists but isn’t being picked up, open a terminal and check to see if /var/lib/snapd/desktop is included in the output of echo $XDG_DATA_DIRS. If it is, then I’m not sure what is going on. If it isn’t, then it would be helpful to know what desktop shell you’re using.

Yes that file exists:

 cat /var/lib/snapd/desktop/applications/poc-sharp_poc-sharp.desktop 

[Desktop Entry]
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/poc-sharp_poc-sharp.desktop /snap/bin/poc-sharp %U


I’m using the default Ubuntu 18.04.2 LTS which is gnome shell I think.

Does it need to have an icon to show up?

You’re missing the Type key in your desktop file. Here is a list of the various keys you can set in your desktop file.

Note that Type is listed as required. In your case, you want Type=Application.

1 Like