aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts
diff options
context:
space:
mode:
authorKKV9 <ciaranob.cob@gmail.com>2024-01-28 18:44:54 +0000
committerKKV9 <ciaranob.cob@gmail.com>2024-01-28 18:44:54 +0000
commita12faec054ccdff3faec2f82390c3b39f3816036 (patch)
tree843d5e76ca34c6ee583bb8480626c98a6bde3946 /config/hypr/UserScripts
parentb51fa2711196eb7ed2e42cd899defd1d233afd89 (diff)
Check arguments before initialise Sounds.sh
Diffstat (limited to 'config/hypr/UserScripts')
-rwxr-xr-xconfig/hypr/UserScripts/Sounds.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/config/hypr/UserScripts/Sounds.sh b/config/hypr/UserScripts/Sounds.sh
index ef62e3f4..99ec9daa 100755
--- a/config/hypr/UserScripts/Sounds.sh
+++ b/config/hypr/UserScripts/Sounds.sh
@@ -10,6 +10,16 @@ if [[ "$muted" = true ]]; then
exit 0
fi
+# Choose the sound to play.
+if [[ "$1" == "--shutter" ]]; then
+ soundoption="camera-shutter.*"
+elif [[ "$1" == "--volume" ]]; then
+ soundoption="audio-volume-change.*"
+else
+ echo -e "Available sounds: --shutter, --volume"
+ exit 0
+fi
+
# Set the directory defaults for system sounds.
userDIR="$HOME/.local/share/sounds"
systemDIR="/usr/share/sounds"
@@ -27,16 +37,6 @@ fi
iTheme=$(cat "$sDIR/index.theme" | grep -i "inherits" | cut -d "=" -f 2)
iDIR="$sDIR/../$iTheme"
-# Choose the sound to play.
-if [[ "$1" == "--shutter" ]]; then
- soundoption="camera-shutter.*"
-elif [[ "$1" == "--volume" ]]; then
- soundoption="audio-volume-change.*"
-else
- echo -e "Available sounds: --shutter, --volume"
- exit 0
-fi
-
# Find the sound file and play it.
sound_file=$(find $sDIR/stereo -name "$soundoption" -print -quit)
if test -f "$sound_file"; then
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage