commit 2a0d8529426b154c93588821103f2576c79002b9
parent 66f99a6912aee5cb2688ba76e9c7c276efa2218c
Author: Jordan Williams <jordan[AT]jwillikers[DOT]com>
Date: Fri, 18 Aug 2023 16:12:50 -0500
Use pactl instead of pacmd
The pacmd command doesn't work on systems using Pipewire's Pulseaudio server.
Instead of the expected output, pacmd returns the following:
No PulseAudio daemon running, or not running as session daemon.
Using pactl instead avoids this problem and works as expected when using Pipewire's pulseaudio server.
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sguard/sguard.sh b/sguard/sguard.sh
@@ -6,9 +6,9 @@
# Checks ----------------------------------------------------------------------
-# is pacmd installed?
-if [[ -z `whereis pacmd | awk '{ print $2 }'` ]]; then
- echo "pacmd is required for sguard to function properly."
+# is pactl installed?
+if [[ -z `whereis pactl | awk '{ print $2 }'` ]]; then
+ echo "pactl is required for sguard to function properly."
exit 1;
fi
@@ -30,7 +30,7 @@ fi
# check player state.
function check_player_state {
- if [[ -z `pacmd list sinks | grep -E "(s|S)tate: RUNNING$"` ]]; then
+ if [[ -z `pactl list sinks | grep -E "(s|S)tate: RUNNING$"` ]]; then
echo false
else
echo true