aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorKKV9 <ciaranob.cob@gmail.com>2024-01-27 23:46:32 +0000
committerKKV9 <ciaranob.cob@gmail.com>2024-01-27 23:46:32 +0000
commitf9bc6913d974d5d1d328b2fb989841640ac93be0 (patch)
tree36454789a9c47bb025fee86df1bffed6faad4313 /config
parentbee9efdf510a71e4b9b4a44e60f9092ab7bd076c (diff)
feat: Add screenshot sounds & notifications
Add sounds for screenshots with freedesktop.org sound theme. Notify for screenshots taken with swappy and move swappy capture to ScreenShot.sh.
Diffstat (limited to 'config')
-rw-r--r--config/hypr/configs/Keybinds.conf2
-rwxr-xr-xconfig/hypr/scripts/ScreenShot.sh14
2 files changed, 14 insertions, 2 deletions
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf
index 1da7e9f7..3ecc4a37 100644
--- a/config/hypr/configs/Keybinds.conf
+++ b/config/hypr/configs/Keybinds.conf
@@ -78,7 +78,7 @@ bind = $mainMod ALT, Print, exec, $scriptsDir/ScreenShot.sh --in10 #screenshot i
bind = ALT, Print, exec, $scriptsDir/ScreenShot.sh --active #screenshot in 10 secs
# screenshot with swappy (another screenshot tool)
-bind = $mainMod SHIFT, S, exec, grim -g "$(slurp)" - | swappy -f -
+bind = $mainMod SHIFT, S, exec, $scriptsDir/ScreenShot.sh --swappy
# Resize windows
binde = $mainMod SHIFT, left, resizeactive,-50 0
diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh
index ddf4398b..d0ec1f5e 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="/usr/share/sounds/freedesktop/stereo"
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")
@@ -29,6 +30,8 @@ notify_view() {
${notify_cmd_shot} "Screenshot NOT Saved."
fi
fi
+ elif [[ "$1" == "swappy" ]]; then
+ ${notify_cmd_shot} "Screenshot Captured."
}
@@ -74,6 +77,13 @@ 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"
@@ -101,8 +111,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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage