dwmbar/modules/volume

21 lines
422 B
Text
Raw Permalink Normal View History

2019-10-21 19:09:02 +00:00
#!/bin/bash
# Prints out the volume percentage
VOLUME_ON_ICON=''
VOLUME_MUTED_ICON=''
get_volume(){
2023-03-01 08:37:26 +00:00
#curStatus=$(pactl get-sink-mute @DEFAULT_SINK@)
volume=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master))
2019-10-21 19:09:02 +00:00
2023-03-01 08:37:26 +00:00
if [ "${curStatus}" = '0%' ]
2019-10-21 19:09:02 +00:00
then
2023-03-01 08:37:26 +00:00
echo "$VOLUME_MUTED_ICON $volume"
2019-10-21 19:09:02 +00:00
else
2023-03-01 08:37:26 +00:00
echo "$VOLUME_ON_ICON $volume"
2019-10-21 19:09:02 +00:00
fi
}
get_volume