aboutsummaryrefslogtreecommitdiff
path: root/bin/screenshot
diff options
context:
space:
mode:
Diffstat (limited to 'bin/screenshot')
-rwxr-xr-xbin/screenshot6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/screenshot b/bin/screenshot
index 94e3bd3..3852fa5 100755
--- a/bin/screenshot
+++ b/bin/screenshot
@@ -12,11 +12,13 @@ FOCUSED=$(swaymsg -t get_tree | jq '.. | (.nodes? // empty)[] | select(.focused)
main() {
rect="$(slurp)"
if [ $? -eq 0 ]; then
- grim -g "$rect" -t png - | wl-copy -t image/png
+ grim -g "$rect" ~/screenshot.png
else
- grim -g "$(eval echo "$FOCUSED")" -t png - | wl-copy -t image/png
+ grim -g "$(eval echo "$FOCUSED")" ~/screenshot.png
+
fi
+ cat ~/screenshot.png | wl-copy -t image/png
}
main "$@"