Solve correct mute info Tint2 icon

Hi,

The “active” volume icon in the Tint2 panel on my install somehow changed to a muted speaker icon and stayed that way even if pulse-audio was not muted.
It took me a while to figure this out but I know now what caused it and, in my case, how to resolve it.

I’m using an equalizer to beef up the sound a bit. Due to this the info on “is the audio muted” inside the mabox script is not recognized by the next commands used in the script. Instead of a simple “no” or “yes” in the output of the command used inside the script it now gives back the mute status of all sinks (an equalizer is seen as another sink module). In my case the output of the command looks like “no”+CRLF+“no” somewhat as an array, multiple rows with “no”.
I have solved this by changing thefollowing line in the script ~/.config/tint2/scripts/volumettf

muted=$(LANG=C pactl get-sink-mute @DEFAULT_SINK@ | awk '/Mute/ { print $2 }')

Then, to set the correct sink muted by leftclick on the volume icon I changed the command in the Tint panel to :

pactl set-sink-mute @DEFAULT_SINK@ toggle

For me this solves the issue and I thought on sharing this with you all. Maybe, if it is a valid command for any install with multiple sinks, it could be changed in the original mabox script and Tint panel?

Hope this helps!

Regards,

BootZ

5 Likes

Thank you @bootz for this. Looks good, I will check this later on my PC and laptop.

We have discussed it earlier - @Ladas552 proposed solution see here:

1 Like

Hi @napcok,

I see. I didn’t find this earlier but I think it differs from mine in sense of that I’m using almost original pulse installation and not using pipewire at the moment.

3 Likes

Sorry for resurrecting an old thread but I also had a problem with this icon in my brand new install 23.08. For me the problem is I have two possible sound outputs in the system, one for 3.5mm audio and one listed as HDMI AMD Renoir.

This meant that ~/.config/tint2/scripts/volumettf script would return two values for $muted and $vol which broke it.

$muted was fixed by changing to this - thanks to @bootz

$(LANG=C pactl get-sink-mute @DEFAULT_SINK@ | awk '/Mute/ { print $2 }')

$vol fixed in an ugly way by adding the head command at the end:

vol=$(LANG=C pactl list sinks | grep -A14 -P "(\#|№)$active_sink" | awk '/Volume: front-left:/{print $5}' | cut -f1 -d'%' **| head -n 1**)

I also changed the Tint panel left click command to @bootz version

pactl set-sink-mute @DEFAULT_SINK@ toggle
4 Likes