fix: not displaying sound for the default device

This commit is contained in:
speedie 2022-11-11 21:53:10 +01:00
parent d4f42f0f64
commit baf09b5baf

View file

@ -49,7 +49,7 @@ CLICK() {
PRINT() { PRINT() {
if [ "$ENABLE_ITEM4" = "true" ]; then if [ "$ENABLE_ITEM4" = "true" ]; then
if [ -e "${BINDIR}pactl" ]; then if [ -e "${BINDIR}pactl" ]; then
echo "$SEPARATOR $ITEM4_ICON $(echo $(pactl get-sink-volume 0 | awk '{print $5;exit}'))" echo "$SEPARATOR $ITEM4_ICON $(echo $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5;exit}'))"
else else
echo "$SEPARATOR $ITEM4_ICON $(echo $(amixer -c 0 get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")%)" echo "$SEPARATOR $ITEM4_ICON $(echo $(amixer -c 0 get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")%)"
fi fi
@ -58,7 +58,7 @@ PRINT() {
# get mute # get mute
if [ "$ITEM4_SHOW_MUTE" = "true" ]; then if [ "$ITEM4_SHOW_MUTE" = "true" ]; then
if [ -e "${BINDIR}pactl" ]; then if [ -e "${BINDIR}pactl" ]; then
pactl get-sink-mute 0 | grep -q yes && echo " $ITEM4_MUTE_TEXT" pactl get-sink-mute @DEFAULT_SINK@ | grep -q yes && echo " $ITEM4_MUTE_TEXT"
fi fi
fi fi
} }