From 909b48934f6c5915c3cd67b4a55d3c40594bbbdd Mon Sep 17 00:00:00 2001 From: KKV9 Date: Sat, 27 Jan 2024 23:59:42 +0000 Subject: [PATCH] Fix last commit --- config/hypr/scripts/ScreenShot.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index d0ec1f5..6b701ff 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -19,19 +19,22 @@ notify_view() { if [[ "$1" == "active" ]]; then if [[ -e "${active_window_path}" ]]; then ${notify_cmd_shot} "Screenshot of '${active_window_class}' Saved." + paplay "${sDIR}/camera-shutter.oga" else ${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved" fi + elif [[ "$1" == "swappy" ]]; then + ${notify_cmd_shot} "Screenshot Captured." else local check_file="$dir/$file" if [[ -e "$check_file" ]]; then ${notify_cmd_shot} "Screenshot Saved." + paplay "${sDIR}/camera-shutter.oga" else ${notify_cmd_shot} "Screenshot NOT Saved." fi fi - elif [[ "$1" == "swappy" ]]; then - ${notify_cmd_shot} "Screenshot Captured." + } @@ -77,13 +80,6 @@ shotarea() { notify_view } -shotswappy() { - tmpfile=$(mktemp) - grim -g "$(slurp)" - >"$tmpfile" && paplay "${sDIR}/camera-shutter.oga" && notify_view "swappy" - swappy -f - <"$tmpfile" - rm "$tmpfile" -} - shotactive() { active_window_class=$(hyprctl -j activewindow | jq -r '(.class)') active_window_file="Screenshot_${time}_${active_window_class}.png" @@ -94,6 +90,13 @@ shotactive() { notify_view "active" } +shotswappy() { + tmpfile=$(mktemp) + grim -g "$(slurp)" - >"$tmpfile" && paplay "${sDIR}/camera-shutter.oga" && notify_view "swappy" + swappy -f - <"$tmpfile" + rm "$tmpfile" +} + if [[ ! -d "$dir" ]]; then mkdir -p "$dir"