aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKKV9 <ciaranob.cob@gmail.com>2024-01-28 17:25:01 +0000
committerKKV9 <ciaranob.cob@gmail.com>2024-01-28 17:25:01 +0000
commit3a48d52e34f033ddf54e732749032c84e79825d6 (patch)
treec154a443d966d8692f630d09054aafb0c4b297fe
parent80433d7fc5a69d9c44123d9768f4216d6275ab03 (diff)
Handle file not found error
Add exit code 1 when no suitable file is found
-rwxr-xr-xconfig/hypr/UserScripts/Sounds.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/config/hypr/UserScripts/Sounds.sh b/config/hypr/UserScripts/Sounds.sh
index 1bcb181b..d7f08e43 100755
--- a/config/hypr/UserScripts/Sounds.sh
+++ b/config/hypr/UserScripts/Sounds.sh
@@ -45,6 +45,11 @@ else
elif test -f "$userDIR/$defaultTheme/$soundoption"; then
pw-play "$userDIR/$defaultTheme/$soundoption"
else
- pw-play "$systemDIR/$defaultTheme/$soundoption"
+ if test -f "$systemDIR/$defaultTheme/$soundoption"; then
+ pw-play "$systemDIR/$defaultTheme/$soundoption"
+ else
+ echo "Error: Sound file not found."
+ exit 1
+ fi
fi
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage