feat(prog/xmobar): add support muted

This commit is contained in:
Dmitriy Pleshevskiy 2022-04-12 23:15:05 +03:00
parent dcc2f3d23a
commit 2cb468f9a5

View file

@ -1,3 +1,9 @@
#!/bin/bash
echo $(amixer -D pulse sget Master | egrep -o "[0-9]+%" | head -n 1)
res=$(amixer -D pulse sget Master)
enabled=$(echo $res | egrep -o "\[on\]" | wc -l)
if [[ $enabled == "0" ]]; then
echo "off"
else
echo $(echo $res | egrep -o "[0-9]+%" | head -n 1)
fi
exit 0