summaryrefslogtreecommitdiff
path: root/config/hyprland/hypr/screenshot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hyprland/hypr/screenshot.sh')
-rwxr-xr-xconfig/hyprland/hypr/screenshot.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/config/hyprland/hypr/screenshot.sh b/config/hyprland/hypr/screenshot.sh
new file mode 100755
index 0000000..533ca98
--- /dev/null
+++ b/config/hyprland/hypr/screenshot.sh
@@ -0,0 +1,21 @@
+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" $HOME/pics/screenshots/"$(date +%y%m%d_%H_%M_%S.png)"
+ ;;
+ "-f")
+ grim $HOME/pics/screenshots/"$(date +%y%m%d_%H_%M_%S.png)"
+ ;;
+ "-s")
+ grim -g "$(slurp)" $HOME/pics/screenshots/"$(date +%y%m%d_%H_%M_%S.png)"
+ ;;
+ "-sc")
+ grim -g "$(slurp)" - | wl-copy
+ ;;
+ *)
+ exit
+ ;;
+esac