summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-30 15:17:43 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-30 15:17:43 +0200
commit2eccb548e8850f8a46adf0316529ff8413bcaf20 (patch)
tree4db14182a826fe736b447e2227f119edd5b0067f
parent0ed78980ef2e82dda50c1d85c094d4cc8638a442 (diff)
fixed screenshots not working because missing folder
-rwxr-xr-xconfig/hyprland/hypr/screenshot.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/config/hyprland/hypr/screenshot.sh b/config/hyprland/hypr/screenshot.sh
index e571b5b..a205bf4 100755
--- a/config/hyprland/hypr/screenshot.sh
+++ b/config/hyprland/hypr/screenshot.sh
@@ -1,8 +1,8 @@
#!/bin/sh
dir="$(xdg-user-dir PICTURES)"
-test -d "$dir" &&
- dir="$HOME/pics"
+dir="${dir:-$HOME/pics}/screenshots"
+mkdir -p "$dir"
case $1 in
"-m")
@@ -10,13 +10,13 @@ case $1 in
actmon="$(hyprctl monitors -j |
jq -r ".[] | select(.id == $actwin)" |
jq -r '.name')"
- grim -o "$actmon" "$dir/screenshots/$(date +%y%m%d_%H_%M_%S.png)"
+ grim -o "$actmon" "$dir/$(date +%y%m%d_%H_%M_%S)_mon.png"
;;
"-f")
- grim "$dir/screenshots/$(date +%y%m%d_%H_%M_%S.png)"
+ grim "$dir/$(date +%y%m%d_%H_%M_%S)_full.png"
;;
"-s")
- grim -g "$(slurp)" "$dir/screenshots/$(date +%y%m%d_%H_%M_%S.png)"
+ grim -g "$(slurp)" "$dir/$(date +%y%m%d_%H_%M_%S)_sel.png"
;;
"-sc")
grim -g "$(slurp)" - | wl-copy