diff options
Diffstat (limited to 'config/hyprland/hypr/screenshot.sh')
-rwxr-xr-x | config/hyprland/hypr/screenshot.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/config/hyprland/hypr/screenshot.sh b/config/hyprland/hypr/screenshot.sh index 533ca98..e571b5b 100755 --- a/config/hyprland/hypr/screenshot.sh +++ b/config/hyprland/hypr/screenshot.sh @@ -1,16 +1,22 @@ +#!/bin/sh + +dir="$(xdg-user-dir PICTURES)" +test -d "$dir" && + dir="$HOME/pics" + 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)" + grim -o "$actmon" "$dir/screenshots/$(date +%y%m%d_%H_%M_%S.png)" ;; "-f") - grim $HOME/pics/screenshots/"$(date +%y%m%d_%H_%M_%S.png)" + grim "$dir/screenshots/$(date +%y%m%d_%H_%M_%S.png)" ;; "-s") - grim -g "$(slurp)" $HOME/pics/screenshots/"$(date +%y%m%d_%H_%M_%S.png)" + grim -g "$(slurp)" "$dir/screenshots/$(date +%y%m%d_%H_%M_%S.png)" ;; "-sc") grim -g "$(slurp)" - | wl-copy |