Ubuntu 20.04 there is no ksnip in the list of possible applications [duplicate]

For editing screengrabs, I prefer to use ksnip, since Shutter was no longer installable without hassles on Ubuntu 18.04 and 20.04

However ksnip is available as a Snap App on my 20.04

○ → snap list | grep ksnip
ksnip                    1.8.0                       265    latest/stable    dporobic               

Unfortunately I have to start ksnip from the command line, then use the File-Open Dialog to pick a screengrab/PNG, then edit it in ksnip. This is should be easier.

What I want is to use Nautilus File manager, then select the "Open with other Application" context menu item to select ksnip, and the have ksnip open the file I picked with nautilus.

Nautilus Context Menu, selecting a PNG:

nautilus contextmenu

"Select Application" Dialog:

select app dialog

How can I achieve this?

There is a "View all Applications" Button, but after clicking, ksnip does NOT appear in this list of apps. "Find new applications" does not work either.

Maybe this is a duplicate, but I think we did not have the combination yet (Hack the dialog and Snap App)

(Note to self: maybe Shutter is usable again. Development had stalled for a while, or it needed a lot of deprecated versions of gnome libs as dependencies) .


Solution 1:

The nautilus right-click menu only picks up applications that are set to launch with an argument, the file name. The .desktop file that comes with the snap is not properly configured in that respect.

• Copy the supplied .desktop file, /var/lib/snapd/desktop/applications/ksnip_ksnip.desktop, to your private ~/.local/share/applications folder.
• Edit your new ~/.local/share/applications/ksnip_ksnip.desktop with a text editor, and add %U after the command to execute the program, so it looks like:

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/ksnip_ksnip.desktop /snap/bin/ksnip %U

• Wait a little and try the right-click menu option of Files again. You may need to exit and restart Files. It should now be listed among your programs.