helm/os/+arch/.config/panel/lemons/volume

22 lines
635 B
Plaintext
Raw Normal View History

#!/usr/bin/env dash
2016-10-19 07:56:37 -07:00
2017-01-03 00:49:10 -08:00
# I expect all volume adjustments to be done through vol.sh (in os/arch/bin), which will
# inform lemonbar of changes, so we only need to intialize volume once here.
2016-10-31 19:07:23 -07:00
2016-11-06 16:40:02 -08:00
. $(dirname $0)/../panel-config
data=$(amixer get Master)
vol=0
if echo "$data" | grep '\[on\]' >/dev/null; then
2016-10-31 19:07:23 -07:00
vol=$(echo "$data" | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)
case $vol in
2017-01-03 00:49:10 -08:00
0) echo "V${ICON_MUTED} " ;;
[1-7]|[1-7][0-9]) echo "V${ICON_SPEAKER_LOW} " ;;
*) echo "V${ICON_SPEAKER}" ;;
2016-11-06 16:40:02 -08:00
esac
else
echo "V%{F${COLOR_DIM}}${ICON_MUTED}%{F-}"
2016-10-31 19:07:23 -07:00
fi
# vim:set ft=sh: