Overriding .desktop files on Ubuntu snaps


Is there a recommended approach for overriding the .desktop files that are bundled with snaps? The ‘normal’ way to do this would be to plop a file with the same name in ~/.local/share/applications/. If I try this in Ubuntu 18.04, I end up with two entries in the applications menu.

My reason for wanting to do the above, is so that I can use custom icons for some snaps; perhaps there’s a better way?



I’ll let others comment on if there is a better way, but if you are doing this, be sure that you are copying the file from /var/lib/snapd/desktop/applications so that your Exec line is using the binary from /snap/bin so it is properly launched under confinement.

1 Like

That seems to do the trick for me - cheers!

The .desktop files are indeed located in /var/lib/snapd/desktop. And their names are in the following format: snap-package-name_original-name.desktop. This explains why overrides with original-name.desktop in ~/.local/share/applications/ did not work. When renamed to snap-package-name_original-name.desktop things work perfectly!

1 Like