diff options
| author | KKV9 <ciaranob.cob@gmail.com> | 2024-02-05 02:00:39 +0000 |
|---|---|---|
| committer | KKV9 <ciaranob.cob@gmail.com> | 2024-02-05 02:00:39 +0000 |
| commit | 69f1e8eaafe756421ca47c7c414b7ddfeb6f7f43 (patch) | |
| tree | 83d9e230c2f3aac491c93e9e9a2ef10d30a307d5 /config/hypr/scripts/ScreenShot.sh | |
| parent | de8e288d1a41351a1945549f3cfe8ea1d356199c (diff) | |
Fix: Area screenshot saving empty files
Area screenshot saves a file on exit and no area has been selected.
Diffstat (limited to 'config/hypr/scripts/ScreenShot.sh')
| -rwxr-xr-x | config/hypr/scripts/ScreenShot.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index fa1b40ad..f35f9292 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -75,7 +75,13 @@ shotwin() { } shotarea() { - cd ${dir} && grim -g "$(slurp)" - | tee "$file" | wl-copy + tmpfile=$(mktemp) + grim -g "$(slurp)" - >"$tmpfile" + if [[ -s "$tmpfile" ]]; then + wl-copy <"$tmpfile" + mv "$tmpfile" "$dir/$file" + fi + rm "$tmpfile" notify_view } |
