summaryrefslogtreecommitdiffstats
path: root/bin/sound.sh
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-07-08 04:00:15 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2012-07-08 04:00:45 +0200
commit3c6cf7ee3eb1cd768072b21c569a69428bf3ce4c (patch)
tree44309ce9656e4c8a157c7ce6d4c5af7fd7903ce7 /bin/sound.sh
downloaddzen2-config-3c6cf7ee3eb1cd768072b21c569a69428bf3ce4c.tar.gz
dzen2-config-3c6cf7ee3eb1cd768072b21c569a69428bf3ce4c.tar.xz
dzen2-config-3c6cf7ee3eb1cd768072b21c569a69428bf3ce4c.zip
inital commit
Diffstat (limited to 'bin/sound.sh')
-rw-r--r--bin/sound.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/sound.sh b/bin/sound.sh
new file mode 100644
index 0000000..036b1c0
--- /dev/null
+++ b/bin/sound.sh
@@ -0,0 +1,25 @@
+function print_mute {
+ local stat VOL MUTE
+
+ stat=$(amixer -c0 get Master | grep "Front Left:")
+ VOL=$(sed 's/^.*\[\(.*\)%\].*$/\1/g' <<< "${stat}")
+ MUTE=$(sed 's/^.*\[\([^\[]*\)\]$/\1/g' <<< "${stat}")
+# VOL=$(amixer -c0 get Master | grep " 0:" | awk '{ print $6 }')
+
+# VOL=$(aumix -d /dev/mixer -q l | grep vol | awk '{ print $3 }')
+# MUTE=${VOL}
+ if [ "${MUTE}" == "off" -o "${MUTE}" == "0" ]
+ then
+ echo "^tw()^fg(#FF0000)^i(/home/alex/.dzen2/icons/vol-mute.xbm)"
+ else
+ echo "^tw()^fg()^i(/home/alex/.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