Fixed wob

This commit is contained in:
ManOfGoldForever 2026-04-07 11:36:59 -04:00
parent b532a2b8f4
commit 29e0e5db25
8 changed files with 52 additions and 11 deletions

View file

@ -0,0 +1,17 @@
#!/bin/bash
# Wait for pipewire/pulseaudio to be ready
until pactl info &>/dev/null; do
sleep 0.5
done
WOB_SOCK="${XDG_RUNTIME_DIR}/wob.sock"
pactl subscribe 2>/dev/null | grep --line-buffered "sink" | while read -r _; do
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+(?=%)' | head -1)
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | grep -c yes)
if [ "$muted" -gt 0 ]; then
echo 0 > "$WOB_SOCK"
else
echo "$vol" > "$WOB_SOCK"
fi
done