2 base=~/.icons/Paper-Mono-Dark/24x24/panel/audio-volume
4 medium=$base-medium.svg
8 # TODO: doesn't work if no master mixer, eg usb dac
9 ident="iface=MIXER,name=Master Playback Volume"
10 eval $(amixer cget "$ident" | grep -o 'max=\d\+')
13 # XXX: assume mono, could be different
14 vol=$(amixer get Master | grep 'Mono:')
15 mute=$(echo "$vol" | cut -d ' ' -f 8)
16 vol=$(expr $(echo "$vol" | cut -d ' ' -f 5) \* 100 / $max \* 100 / 100)
17 if [ $mute = '[off]' ]; then
19 elif [ $vol -ge 75 ]; then
21 elif [ $vol -ge 50 ]; then
23 elif [ $vol -ge 25 ]; then