diff options
| author | KKV9 <ciaranob.cob@gmail.com> | 2024-01-28 17:25:01 +0000 |
|---|---|---|
| committer | KKV9 <ciaranob.cob@gmail.com> | 2024-01-28 17:25:01 +0000 |
| commit | 3a48d52e34f033ddf54e732749032c84e79825d6 (patch) | |
| tree | c154a443d966d8692f630d09054aafb0c4b297fe | |
| parent | 80433d7fc5a69d9c44123d9768f4216d6275ab03 (diff) | |
Handle file not found error
Add exit code 1 when no suitable file is found
| -rwxr-xr-x | config/hypr/UserScripts/Sounds.sh | 7 |
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 |
