Update soundtest
[grml-scripts.git] / usr_bin / XF86AudioLowerVolume
1 #!/bin/sh
2 # Filename:      XF86AudioLowerVolume
3 # Purpose:       lower audio volume
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 # Latest change: Die Aug 01 01:18:07 CEST 2006 [mika]
8 ################################################################################
9
10 . /etc/grml/lsb-functions
11
12 aumix -v -5 ; RC=$?
13
14 if ! [ "$RC" = 0 ] ; then
15    eend "Error running 'aumix -v -5'" ; eend 1
16 fi
17
18 VOLUME=$(aumix -q | awk -F, '/vol/ {print $2}')
19
20 if [ -n "$DISPLAY" ] ; then
21   einfo "Lowered audio volume to${VOLUME}" ; eend $?
22   osd_cat -b percentage -P $VOLUME -d 2 -c orange -A center -p middle
23 else
24   einfo "Lowered audio volume to${VOLUME}" ; eend $?
25 fi
26
27 ## END OF FILE #################################################################