.vscode | ||
docs/images | ||
include | ||
protocol | ||
res | ||
src | ||
.clang-format | ||
.gitignore | ||
LICENSE | ||
meson_options.txt | ||
meson.build | ||
README.md | ||
swappy.1.scd |
swappy
A Wayland native snapshot and editor tool, inspired by Snappy on macOS. Works great with slurp and sway.
Wayland code was largely taken from grim.
Screenshot
Example usage
Swappshot a region:
swappy -g "100,100 200x200"
Select a region and swappshot it:
swappy -g "$(slurp)"
Grab a swappshot from a specific window under Sway, using swaymsg
and jq
:
swappy -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)"
Keyboard Shortcuts
-
Ctrl+b
: Toggle Paint Panel -
b
: Switch to Brush -
t
: Switch to Text -
r
: Switch to Rectangle -
o
: Switch to Ellipse -
a
: Switch to Arrow -
R
: Use Red Color -
G
: Use Green Color -
B
: Use Blue Color -
C
: Use Custom Color -
Minus
: Reduce Stroke Size -
Plus
: Increase Stroke Size -
Equal
: Reset Stroke Size -
k
: Clear Paints (cannot be undone) -
Ctrl+z
: Undo -
Ctrl+Shift+z
orCtrl+y
: Redo -
Ctrl+s
: Save to file (see man page). -
Ctrl+c
: Copy to clipboard
Limitations
- Mutli-Monitor: I don't have a multi-monitor setup at home. Most likely it won't work properly. Pull requests are welcome.
- Copy: Copy to clipboard won't work if you close swappy (the content of the clipboard is lost). This because GTK 3.24 has not implemented persistent storage. We need to do it on the Wayland level, or wait for GTK 4.
Installation
Arch Linux User Repository
Assuming yay as your AUR package manager:
- stable:
yay -S swappy
- latest:
yay -S swappy-git
Building from source
Install dependencies:
- meson
- wayland
- cairo
- gtk
Optional dependencies:
- libnotify
Then run:
meson build
ninja -C build
Contributing
Pull requests are welcome.
License
MIT