diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-02-14 05:22:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-14 05:22:34 +0900 |
| commit | a160ceeab550d8fdefc0b19f6b3a0dd6c2784db8 (patch) | |
| tree | bf2ebecab995012b984c931e2ec22d947897b4b3 /config/hypr/scripts/ScreenShot.sh | |
| parent | 610a46e8fe3c5c0d0b292977b6015d9f858e5e98 (diff) | |
| parent | e34165295e0856f9f14fffb4e323fb1f2e2220c9 (diff) | |
Merge pull request #158 from JaKooLit/development
Development to Main
Diffstat (limited to 'config/hypr/scripts/ScreenShot.sh')
| -rwxr-xr-x | config/hypr/scripts/ScreenShot.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index ddf4398b..fa1b40ad 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -3,6 +3,7 @@ # Screenshots scripts iDIR="$HOME/.config/swaync/icons" +sDIR="$HOME/.config/hypr/UserScripts" notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png" time=$(date "+%d-%b_%H-%M-%S") @@ -18,13 +19,17 @@ notify_view() { if [[ "$1" == "active" ]]; then if [[ -e "${active_window_path}" ]]; then ${notify_cmd_shot} "Screenshot of '${active_window_class}' Saved." + "${sDIR}/Sounds.sh" --screenshot 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." + "${sDIR}/Sounds.sh" --screenshot else ${notify_cmd_shot} "Screenshot NOT Saved." fi @@ -84,6 +89,13 @@ shotactive() { notify_view "active" } +shotswappy() { + tmpfile=$(mktemp) + grim -g "$(slurp)" - >"$tmpfile" && "${sDIR}/Sounds.sh" --screenshot && notify_view "swappy" + swappy -f - <"$tmpfile" + rm "$tmpfile" +} + if [[ ! -d "$dir" ]]; then mkdir -p "$dir" @@ -101,8 +113,10 @@ elif [[ "$1" == "--area" ]]; then shotarea elif [[ "$1" == "--active" ]]; then shotactive +elif [[ "$1" == "--swappy" ]]; then + shotswappy else - echo -e "Available Options : --now --in5 --in10 --win --area --active" + echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy" fi exit 0 |
