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

20 lines
371 B
Bash
Raw Normal View History

2016-10-19 07:56:37 -07:00
#!/usr/bin/env bash
2016-10-31 19:07:23 -07:00
muted="\ue202"
speaker="\ue203"
data=$(amixer get Master)
vol=0
if echo "$data" | grep '\[on\]' >/dev/null
then
vol=$(echo "$data" | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)
fi
case "$vol" in
0) text="%{F$COLOR_FREE_FG}${muted}%{F-}"
;;
*) text="${speaker} ${vol}%"
;;
esac
echo "V%{A:volume.sh toggle:} ${text} %{A}"