This my .desktop file for HotShots: [Desktop Entry] Version=2.2.0 Name=HotShots Comment=Screenshot manager Type=Application GenericName=Screenshot manager TryExec=/usr/bin/hotshots Exec=/usr/bin/hotshots --no-singleinstance Categories=Utility;Application; Icon=/usr/share/pixmaps/hotshots.png MimeType=application/x-hot;image/png;image/gif;image/jpeg;image/jpg; Notice the '--no-singleinstance' parameter to Exec. When I launch HotShots using mimeopen, $ mimeopen -a Screenshot_2017-09-26_11-39-04.png this is the output of execsnoop (https://github.com/iovisor/bcc/blob/master/tools/execsnoop_example.txt): mimeopen 12255 10881 0 /usr/bin/vendor_perl/mimeopen -a Screenshot_2017-09-26_11-39-04.png hotshots 12255 10881 0 /usr/bin/hotshots --no-singleinstance Screenshot_2017-09-26_11-39-04.png When I use screenshooter to open a screenshot, this is the output of execsnoop: xfce4-screensho 12306 2258 0 /usr/bin/xfce4-screenshooter -r hotshots 12312 1 0 /usr/bin/hotshots /tmp/Screenshot_2017-09-26_12-08-36.png This shows, that the extra parameter to HotShots is correctly recognized by the system, but ignored by screenshooter.
Currently screenshooter uses g_app_info_get_all_for_type to get a list of apps that handle the mime "image/png". Then for each item on that list, it extracts the command with g_app_info_get_executable, which internally gio calls of info->binary and defines as "the first word in an exec line". So xfce4-screenshooter makes a call such as: <command> <path to screenshot>. Easy peasy, but to call the command as in Exec (g_app_info_get_commandline) it would be necessary to replace the field codes (%f, %F, %U, %u), if none is present just append the path to the screenshot. Not really that complicated, but requires testing, especially for popular apps (Risttreto, Viewnior, GIMP, eog...) to make sure we don't break working stuff. Well, don't hold your breath, this improvement will remain on my (very) long TODO list for a while. On the other hand, a patch would be reviewed and merged ASAP ;)
I changed the code to use g_app_info_launch() for command launching. It does all necessary parsing and replacement. See use_g_app_info_launch.patch.
Created attachment 7350 Use g_app_info_launch() for command launching
Eduard Wirch referenced this bugreport in commit e86731e3373538f64c0ac71bb2562e7fb3ec2c69 Use g_app_info_launch() for command launching (Bug #13886) https://git.xfce.org/apps/xfce4-screenshooter/commit?id=e86731e3373538f64c0ac71bb2562e7fb3ec2c69
I have successfully tested with Ristretto, eog, feh, GIMP and Viewnior. Reviewed and merged as promised, thanks!
Ops, forgot to close...