jtheoof / swappy

A Wayland native snapshot editing tool, inspired by Snappy on macOS
MIT License
1k stars 40 forks source link
annotation-tool screenshot snappy snapshot sway wayland

swappy

A Wayland native snapshot and editor tool, inspired by Snappy on macOS. Works great with grim, slurp and sway. But can easily work with other screen copy tools that can output a final image to stdout. See below.

Screenshot

Swappy Screenshot

Example usage

Output of grim (or any tool outputting an image file):

grim -g "$(slurp)" - | swappy -f -

Swappshot a PNG file:

swappy -f "~/Desktop/my-gnome-saved-file.png"

Print final surface to stdout (useful to pipe with other tools):

grim -g "$(slurp)" - | swappy -f - -o - | pngquant -

Grab a swappshot from a specific window under Sway, using swaymsg and jq:

grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" - | swappy -f -

Config

The config file is located at $XDG_CONFIG_HOME/swappy/config or at $HOME/.config/swappy/config.

The file follows the GLib conf format. See the man page for details. There is example config file here.

The following lines can be used as swappy's default:

[Default]
save_dir=$HOME/Desktop
save_filename_format=swappy-%Y%m%d-%H%M%S.png
show_panel=false
line_size=5
text_size=20
text_font=sans-serif
paint_mode=brush
early_exit=false
fill_shape=false

Keyboard Shortcuts





Limitations

Installation

Building from source

Install dependencies (on Arch, name can vary for other distros):

Optional dependencies:

Then run:

meson setup build
ninja -C build

i18n

This section is for developers, maintainers and translators.

To add support to a new locale or when translations are updated:

  1. Update src/po/LINGUAS (when new locales are added)
  2. Generate a new po file (ignore and do not commit potential noise in other files):
ninja -C build swappy-update-po

To rebuild the base template (should happen less often):

ninja -C build swappy-pot

See the meson documentation for details.

Contributing

Pull requests are welcome. This project uses conventional commits to automate changelog generation.

Release

We rely on standard-version which is part of the JavaScript ecosystem but works well with any project.

./script/github-release

Make sure everything is valid in the Draft release, then publish the draft.

Release tarballs are signed with this PGP key: F44D05A50F6C9EB5C81BCF966A6B35DBE9442683

License

MIT