2017-11-22 01:27:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-09-09 20:04:37 +02:00
|
|
|
if [[ "$instance" == mic ]]
|
|
|
|
then
|
|
|
|
options=" --default-source"
|
|
|
|
fi
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2019-09-09 20:04:37 +02:00
|
|
|
mixer="pamixer${options}"
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2019-09-09 20:04:37 +02:00
|
|
|
case $button in
|
|
|
|
1) $mixer -d 1;;
|
|
|
|
2) $mixer -t;;
|
|
|
|
3) $mixer -i 1;;
|
|
|
|
4) $mixer -i 5;;
|
|
|
|
5) $mixer -d 5;;
|
|
|
|
esac
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2019-09-09 20:04:37 +02:00
|
|
|
volume="$($mixer --get-volume)"
|
|
|
|
muted="$($mixer --get-mute)"
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2019-09-09 20:04:37 +02:00
|
|
|
if $muted
|
|
|
|
then
|
|
|
|
color="#F2777A"
|
|
|
|
else
|
|
|
|
color="#99CC99"
|
|
|
|
fi
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2019-09-09 20:04:37 +02:00
|
|
|
printf "%s <span foreground=\"%s\">%2d%%</span>\n" "$BLOCK_INSTANCE" "$color" "$volume"
|
2017-11-22 01:27:01 +01:00
|
|
|
|