jtheoof / swappy

A Wayland native snapshot editing tool, inspired by Snappy on macOS
MIT License
1k stars 40 forks source link

Extend desktop file to support screenshot actions #97

Closed markstos closed 3 years ago

markstos commented 3 years ago

It's super convenient to be able to take a screenshot and pass it to Swappy in one step.

Actions in the .desktop file feel like a natural place to offer these options.

Using rofi as a launcher, ".desktop" file actions are findable if the -drun-show-actions is passed.

With these actions, you can snapshot any of the following and have the result opened in swappy:

The downside is that these depend on grimshot, which is part of the sway project in the contrib/ directory there.

Some of the grimshot logic in turn depends on swaymsg.

Maybe these desktop actions are better hosted in another project since this one currently doesn't depend on Sway, but I thought I would share the idea here to start a conversation.

Another option would be to create a contrib/grimshot-swappy.desktop file. Sway users could opt to install it.

Thanks!

jtheoof commented 3 years ago

Thanks for the suggestion @markstos but as you mentioned I don't think swappy is the right place to do this.

Swappy should try to remain agnostic of the ecosystem it's in (sway or grimshot). Some users may use it in a pure Gnome shell environment, and this would break for them.

Maybe try in sway repo itself.

markstos commented 3 years ago

Makes sense. I think Sway will be agnostic to Swappy though.

markstos commented 3 years ago

I added the tip on Grimshot/Sway integration to the Sway wiki: https://github.com/swaywm/sway/wiki/Tricks#take-screenshots-and-open-them-in-annotation-tool

In looking at the .desktop file shipped here, it wasn't clear why Terminal=true is included-- this causes a terminal to open in addition to Swappy. I tested with Terminal=false and it seems to work fine.