Keep it short.

This commit is contained in:
Bartek Stalewski 2022-04-14 10:33:51 +02:00
parent c5a5df67a0
commit 51233cea8d
4 changed files with 16 additions and 17 deletions

View file

@ -12,17 +12,17 @@ if [ "${1}" = "micmute" ]; then
esac
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}')
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
micmute=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
if [ "$volmute" = yes ] && [ "$micmute" = yes ]; then
volmute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}')
if [ "$micmute" = yes ] && [ "$volmute" = yes ]; then
printf "^c#ffffff^^b#770000^\uf131 mute | \ufa80 mute^d^"
elif [ "$vol" -eq 0 ] && [ "$mic" -eq 0 ]; then
elif [ "$mic" -eq 0 ] && [ "$vol" -eq 0 ]; then
printf "^c#ffffff^^b#770000^\uf131 mute | \ufa80 mute^d^"
else
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micinfo="^c#ffffff^^b#770000^\uf131 mute | ^d^" || micinfo=""
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && volinfo="^c#ffffff^^b#770000^\ufa80 mute^d^" || volinfo="\uf028 ${vol}%%"
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micinfo="^c#ffffff^^b#770000^\uf131 mute^d^" || micinfo="\uf130 ${mic}%%"
printf "${micinfo} | ${volinfo}"
printf "${micinfo}${volinfo}"
fi
fi