aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts
diff options
context:
space:
mode:
authorJohn Titor <50095635+JohnRTitor@users.noreply.github.com>2024-04-01 11:06:32 +0530
committerJohn Titor <50095635+JohnRTitor@users.noreply.github.com>2024-04-01 11:53:48 +0530
commitcecd38e1ccc74b12332608ed115559ff899ef9dc (patch)
treecdf3fb6e12cdb48b826da70200fc9464d634da95 /config/hypr/UserScripts
parent1ecaaeef3bb759125ab78f41ea7797c573537a6b (diff)
PATCH: userscripts/Sounds.sh: for Non-FHS systems, use the runtime dir
on Non-FHS systems like NixOS, the system sounds are located in /run/current-system/sw/share/sounds according to XDG specification This patch allows the script to fallback to this directory if the sound files are not found in /usr/share/sounds or $HOME/.local/share/sounds
Diffstat (limited to 'config/hypr/UserScripts')
-rwxr-xr-xconfig/hypr/UserScripts/Sounds.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/config/hypr/UserScripts/Sounds.sh b/config/hypr/UserScripts/Sounds.sh
index 7c9100d5..fb8a1f57 100755
--- a/config/hypr/UserScripts/Sounds.sh
+++ b/config/hypr/UserScripts/Sounds.sh
@@ -31,8 +31,12 @@ else
fi
# Set the directory defaults for system sounds.
+if [ -d "/run/current-system/sw/share/sounds" ]; then
+ systemDIR="/run/current-system/sw/share/sounds" # NixOS
+else
+ systemDIR="/usr/share/sounds"
+fi
userDIR="$HOME/.local/share/sounds"
-systemDIR="/usr/share/sounds"
defaultTheme="freedesktop"
# Prefer the user's theme, but use the system's if it doesn't exist.
@@ -62,4 +66,4 @@ if ! test -f "$sound_file"; then
fi
fi
fi
-pw-play "$sound_file"
+pw-play "$sound_file" \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage