summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/hyprland/hypr/binds.conf10
-rwxr-xr-xconfig/hyprland/hypr/screenshot.sh21
2 files changed, 25 insertions, 6 deletions
diff --git a/config/hyprland/hypr/binds.conf b/config/hyprland/hypr/binds.conf
index c93e77d..e1dc381 100644
--- a/config/hyprland/hypr/binds.conf
+++ b/config/hyprland/hypr/binds.conf
@@ -114,9 +114,7 @@ bind =, XF86MonBrightnessDown, exec, light -U 5
bind = $mainMod SHIFT, B, exec, killall waybar; waybar
-$actshot = grim -o "$(hyprctl monitors -j | jq -r ".[] | select(.id == "$(hyprctl activewindow -j | jq -r '.monitor')")" | jq -r '.name')"
-$selshot = grim -g "$(slurp)" /dev/stdout | wl-copy
-
-bind = $mainMod ALT, S, exec, $actshot
-bind = $mainMod SHIFT, S, exec, $selshot
-bind = $mainMod ALT SHIFT, S, exec, $actshot /dev/stdout | wl-copy
+bind = $mainMod ALT, S, exec, $HOME/.config/hypr/screenshot.sh -m
+bind = $mainMod SHIFT, S, exec, $HOME/.config/hypr/screenshot.sh -sc
+bind = $mainMod ALT SHIFT, S, exec, $HOME/.config/hypr/screenshot.sh -s
+bind = $mainMod CTRL, S, exec, $HOME/.config/hypr/screenshot.sh -f
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