#!/bin/bash # this version works with ALSA. developed on debian/woody but should work anywhere. # PB: updated for alsa-0.9.0beta4 function read_volume() { #aumix-minimal -vq | cut -d\ -f 3 setmixer -V | grep "vol" | cut -d \- -f 2 | cut -d , -f 1 } msg_on="LABEL Unmute\nCOLOR yellow" msg_off="LABEL Mute\nCOLOR white" VOLUME=`read_volume` case $VOLUME in " 0") echo -e "$msg_on\nOK" read press OLDVOL=`cat ~/.mutevol` #aumix-minimal -v$OLDVOL && echo -e "$msg_off" setmixer vol $OLDVOL && echo -e "$msg_off" echo "OK" ;; *) echo -e "$msg_off\nOK" read press echo $VOLUME > ~/.mutevol #aumix-minimal -v0 && echo -e "$msg_on" setmixer vol 0 && echo -e "$msg_on" echo "OK" ;; esac