#!/bin/sh cd $HOME action=$1; shift killall -q osd_cat > /dev/null 2>&1 get_volume() { volume=`aumix -q | sed -ne 's/^vol \([^,]*\).*/\1/p'` } show_volume() { xosd --text Volume:\ $1 --barmode=percentage --percentage=$1 } case "$action" in incr) delta=${1:-5} rm -f .mutevol aumix -v +$delta get_volume show_volume $volume ;; decr) delta=${1:-5} rm -f .mutevol aumix -v -$delta get_volume show_volume $volume ;; mute) if [ -s .mutevol ] then vol=`cat .mutevol` rm -f .mutevol aumix -v $vol # echo "Volume: $vol" | xosd -- - show_volume $vol else get_volume [ $volume != 0 ] && echo $volume > .mutevol aumix -v 0 echo "Volume: muted" | xosd -- - fi ;; esac # =head1 AUTHOR # # Johan Vromans # # =head1 COPYRIGHT AND DISCLAIMER # # This program is Copyright 2004,2005 by Johan Vromans. # This program is free software; you can redistribute it and/or # modify it under the terms of the Perl Artistic License or the # GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any # later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # If you do not have a copy of the GNU General Public License write to # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, # MA 02139, USA.