blob: 5153375816a3a3ab3cb6b4ec68207ca35cf22cd3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
print_mute() {
local stat VOL MUTE
stat=$(amixer -c0 get Master | grep "\(Mono\|Front Left\):")
VOL=$(echo "${stat}" | sed 's/^.*\[\(.*\)%\].*$/\1/g')
MUTE=$(echo "${stat}" | sed 's/^.*\[\([^\[]*\)\]$/\1/g')
if [ "${MUTE}" = "off" -o "${MUTE}" = "0" ]
then
echo "^tw()^fg(#FF0000)^i(${HOME}/.dzen2/icons/vol-mute.xbm)"
else
echo "^tw()^fg()^i(${HOME}/.dzen2/icons/vol-hi.xbm)"
fi
echo "$(echo "$VOL" | tail -n 1)" | gdbar -h 6 -w 50 -fg '#999' -bg '#444'
}
print_mute
inotifywait -q -m /dev/snd/controlC0 -e ACCESS | while read i
do
print_mute
done
|