diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-04 10:42:48 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-04 10:42:48 +0200 |
commit | ea7ab17e95f064d5caec78ce72b9092377c1fb4a (patch) | |
tree | 9cdf33c5099e42d445a3874757703025bc16174a | |
parent | af5ea6bf281d44bb3ee2dce1d30e263e94ef22dc (diff) |
use date variable for filename
-rwxr-xr-x | config/hyprland/hypr/screenshot.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/config/hyprland/hypr/screenshot.sh b/config/hyprland/hypr/screenshot.sh index a205bf4..694e099 100755 --- a/config/hyprland/hypr/screenshot.sh +++ b/config/hyprland/hypr/screenshot.sh @@ -2,6 +2,7 @@ dir="$(xdg-user-dir PICTURES)" dir="${dir:-$HOME/pics}/screenshots" +date="$(date +%y%m%d_%H_%M_%S)" mkdir -p "$dir" case $1 in @@ -10,13 +11,13 @@ case $1 in actmon="$(hyprctl monitors -j | jq -r ".[] | select(.id == $actwin)" | jq -r '.name')" - grim -o "$actmon" "$dir/$(date +%y%m%d_%H_%M_%S)_mon.png" + grim -o "$actmon" "$dir/${date}_mon.png" ;; "-f") - grim "$dir/$(date +%y%m%d_%H_%M_%S)_full.png" + grim "$dir/${date}_full.png" ;; "-s") - grim -g "$(slurp)" "$dir/$(date +%y%m%d_%H_%M_%S)_sel.png" + grim -g "$(slurp)" "$dir/${date}_sel.png" ;; "-sc") grim -g "$(slurp)" - | wl-copy |