summaryrefslogtreecommitdiff
path: root/config/wayland/hypr/screenshot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/wayland/hypr/screenshot.sh')
-rwxr-xr-xconfig/wayland/hypr/screenshot.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/config/wayland/hypr/screenshot.sh b/config/wayland/hypr/screenshot.sh
new file mode 100755
index 0000000..694e099
--- /dev/null
+++ b/config/wayland/hypr/screenshot.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+dir="$(xdg-user-dir PICTURES)"
+dir="${dir:-$HOME/pics}/screenshots"
+date="$(date +%y%m%d_%H_%M_%S)"
+mkdir -p "$dir"
+
+case $1 in
+ "-m")
+ actwin="$(hyprctl activewindow -j | jq -r '.monitor')"
+ actmon="$(hyprctl monitors -j |
+ jq -r ".[] | select(.id == $actwin)" |
+ jq -r '.name')"
+ grim -o "$actmon" "$dir/${date}_mon.png"
+ ;;
+ "-f")
+ grim "$dir/${date}_full.png"
+ ;;
+ "-s")
+ grim -g "$(slurp)" "$dir/${date}_sel.png"
+ ;;
+ "-sc")
+ grim -g "$(slurp)" - | wl-copy
+ ;;
+ *)
+ exit
+ ;;
+esac