From df6c626e613838ded886bd33ea4c7f7fb0882cd7 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 Jan 2025 15:51:06 +0900 Subject: improved swappy --- config/hypr/scripts/ScreenShot.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 7cc28afc..2089c033 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -39,7 +39,15 @@ notify_view() { elif [[ "$1" == "swappy" ]]; then "${sDIR}/Sounds.sh" --screenshot - ${notify_swappy} "Screenshot Captured (swappy)" + resp=$(${notify_cmd_shot} "Screenshot Captured (swappy)") + case "$resp" in + action1) + swappy -f - <"$tmpfile" + ;; + action2) + rm "$tmpfile" + ;; + esac else local check_file="${dir}/${file}" @@ -82,7 +90,7 @@ shot5() { countdown '5' sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy sleep 1 - notify_view + notify_view } shot10() { @@ -121,8 +129,6 @@ shotactive() { shotswappy() { tmpfile=$(mktemp) grim -g "$(slurp)" - >"$tmpfile" && notify_view "swappy" - swappy -f - <"$tmpfile" - rm "$tmpfile" } if [[ ! -d "$dir" ]]; then @@ -147,4 +153,4 @@ else echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy" fi -exit 0 +exit 0 \ No newline at end of file -- cgit v1.2.3