2019-10-21 19:09:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Prints out the volume percentage
|
|
|
|
|
|
|
|
VOLUME_ON_ICON=''
|
|
|
|
VOLUME_MUTED_ICON=''
|
|
|
|
|
|
|
|
get_volume(){
|
2021-12-14 12:22:13 +00:00
|
|
|
curStatus=$(pactl get-sink-mute @DEFAULT_SINK@)
|
|
|
|
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | tail -n 2 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' | head -n 1)
|
2019-10-21 19:09:02 +00:00
|
|
|
|
2021-12-07 23:13:55 +00:00
|
|
|
if [ "${curStatus}" = 'Mute: yes' ]
|
2019-10-21 19:09:02 +00:00
|
|
|
then
|
2019-10-28 14:20:01 +00:00
|
|
|
echo "$VOLUME_MUTED_ICON $volume%"
|
2019-10-21 19:09:02 +00:00
|
|
|
else
|
2019-10-28 14:20:01 +00:00
|
|
|
echo "$VOLUME_ON_ICON $volume%"
|
2019-10-21 19:09:02 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
get_volume
|