sway-interactive-screenshot is as simple bash script to take screenshot easly on sway. Just launch the script and it will ask you what you want to take a screenshot.
If you are using Archlinux, you can install sway-interactive-screenshot with the AUR package sway-interactive-screenshot
(e.g. yay -S sway-interactive-screenshot
).
swaywm
obviouslyjq
to parseswaymsg
JSON response that lists windowsrofi
to prompt what you want to take a screenshot ofgrim
to take the screenshotslurp
to select an area on the screenswappy
(optional) to edit the captured screenshotnotify-send
to send a notification to notification daomon (such asmako
)wl-copy
to copy the screenshot to the clipboard
To bind this script to the Print
key, just add this to your ~/.config/sway/config
:
bindsym Print exec /path/to/sway-interactive-screenshot
By default, sway-interactive-screenshot
saves the screenshots in the home directory. You can change that by setting the SWAY_INTERACTIVE_SCREENSHOT_SAVEDIR
environment variable to another directory.