summaryrefslogtreecommitdiffstats
path: root/script/screenshot
diff options
context:
space:
mode:
Diffstat (limited to 'script/screenshot')
-rwxr-xr-xscript/screenshot8
1 files changed, 8 insertions, 0 deletions
diff --git a/script/screenshot b/script/screenshot
new file mode 100755
index 0000000..b5b3e0a
--- /dev/null
+++ b/script/screenshot
@@ -0,0 +1,8 @@
+#!/bin/sh
+timeout 30 slurp > /tmp/selection.txt 2>/dev/null
+if [ $? -eq 0 ] && [ -s /tmp/selection.txt ]; then
+ grim -g "$(cat /tmp/selection.txt)" - | wl-copy
+else
+ grim - | wl-copy
+fi
+rm -f /tmp/selection.txt