mirror of
https://github.com/jtheoof/swappy.git
synced 2024-08-17 02:30:47 +03:00
A Wayland native snapshot editing tool, inspired by Snappy on macOS
.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 Brusht
: Switch to Textr
: Switch to Rectangleo
: Switch to Ellipsea
: Switch to Arrow
R
: Use Red ColorG
: Use Green ColorB
: Use Blue ColorC
: Use Custom ColorMinus
: Reduce Stroke SizePlus
: Increase Stroke SizeEqual
: Reset Stroke Sizek
: Clear Paints (cannot be undone)
Ctrl+z
: UndoCtrl+Shift+z
orCtrl+y
: RedoCtrl+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