Show mic volume on statusbar.

This commit is contained in:
Bartek Stalewski 2022-02-20 03:15:31 +01:00
parent bbac22c95e
commit a58960169f

View File

@ -13,13 +13,14 @@ if [ "${1}" = "micmute" ]; then
kill -46 $(pidof dwmblocks)
else
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
volmute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}')
micmute=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
if [ "$volmute" = yes ] && [ "$micmute" = yes ]; then
printf "^c#161616^^b#fd4285^\ue02b + \ue04f^d^"
printf "^c#161616^^b#fd4285^\ue02b mute \ue04f mute^d^"
else
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] && volinfo="^c#161616^^b#fd4285^mute \ue04f^d^" || volinfo="${vol}%% \ue050"
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] && micinfo="^c#161616^^b#fd4285^\ue02b mute^d^" || micinfo=""
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] && micinfo="^c#161616^^b#fd4285^\ue02b mute^d^" || micinfo="${mic}%% \ue029"
printf "${micinfo} ${volinfo}"
fi
fi