From e2c1144266279c6b522b4ff7e96f578f85b0fcbf Mon Sep 17 00:00:00 2001 From: KKV9 Date: Sun, 28 Jan 2024 21:06:07 +0000 Subject: [PATCH] Fix fallback sounds Fix Sounds.sh not finding files correctly. --- config/hypr/UserScripts/Sounds.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/config/hypr/UserScripts/Sounds.sh b/config/hypr/UserScripts/Sounds.sh index bc27c92..0d2bfff 100755 --- a/config/hypr/UserScripts/Sounds.sh +++ b/config/hypr/UserScripts/Sounds.sh @@ -49,20 +49,17 @@ iDIR="$sDIR/../$iTheme" # Find the sound file and play it. sound_file=$(find $sDIR/stereo -name "$soundoption" -print -quit) -if test -f "$sound_file"; then - pw-play "$sound_file" -else +if ! test -f "$sound_file"; then sound_file=$(find $iDIR/stereo -name "$soundoption" -print -quit) - if test -f "$sound_file"; then - pw-play "$sound_file" - elif test -f "$userDIR/$defaultTheme/$soundoption"; then - pw-play "$userDIR/$defaultTheme/$soundoption" - else - if test -f "$systemDIR/$defaultTheme/$soundoption"; then - pw-play "$systemDIR/$defaultTheme/$soundoption" - else - echo "Error: Sound file not found." - exit 1 + if ! test -f "$sound_file"; then + sound_file=$(find $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit) + if ! test -f "$sound_file"; then + sound_file=$(find $systemDIR/$defaultTheme/stereo -name "$soundoption" -print -quit) + if ! test -f "$sound_file"; then + echo "Error: Sound file not found." + exit 1 + fi fi fi fi +pw-play "$sound_file"