summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/xorg/xbindkeysrc8
-rwxr-xr-xlocal/bin/screenshot.sh21
2 files changed, 28 insertions, 1 deletions
diff --git a/config/xorg/xbindkeysrc b/config/xorg/xbindkeysrc
index 9437ef0..61a978e 100644
--- a/config/xorg/xbindkeysrc
+++ b/config/xorg/xbindkeysrc
@@ -123,7 +123,7 @@
Shift+Mod4 + j
# XF86MonBrightnessDown
-# dwm
+# Suckless desktop
# --------------------
"dmenu-webshortcuts.sh"
@@ -132,6 +132,12 @@
"dmenu-emojicopy.sh"
Alt + e
+"screenshot.sh"
+ Print
+
+"screenshot.sh screen"
+ Shift + Print
+
# Launch applications (super + key)
# ---------------------------------
diff --git a/local/bin/screenshot.sh b/local/bin/screenshot.sh
new file mode 100755
index 0000000..c15ce37
--- /dev/null
+++ b/local/bin/screenshot.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Takes a screenshot and saves it
+
+# Inspired by Denshi's screenshot script (https://git.denshi.org/Scripts/tree/screenshot).
+# See also https://www.youtube.com/watch?v=uYNTFg3_QaY&t=243s
+
+savepath="$HOME/media/Pictures/Screenshots"
+filename="$HOSTNAME-$(date -Iseconds | tr -d ':-').png"
+
+if [ "$1" == "screen" ]; then
+ # capture the screen determined by the cursor location
+ shotgun -s "$savepath/$filename"
+elif [ "$1" == "screens" ]; then
+ # TODO: This is not currently possible with shotgun 2.5.1
+ :
+else
+ # capture a region of the screen
+ shotgun -g $(hacksaw -c fff) "$savepath/$filename"
+fi
+