diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-30 10:41:21 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-30 10:41:21 +0200 |
commit | 40d15e0ce1b66db2cb40099bc2f511af9ed7b59f (patch) | |
tree | 27887f769cc5e11526ba512fe03a8bdba0291817 | |
parent | fb429acf4c6526dede38975abcee85fff0c86c9c (diff) |
use xdg for output dir
-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 |