Depend on console-tools; drop runit
[grml-scripts.git] / usr_bin / XF86AudioMute
1 #!/bin/sh
2 # Filename:      XF86AudioMute
3 # Purpose:       mute and restore audio settings
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: Sun May 14 15:03:53 CEST 2006 [mika]
8 ################################################################################
9
10 . /etc/grml/lsb-functions
11
12 UNMUT="Sound unmuted"
13 MUT="Sound muted"
14
15 if [ -f ~/.aumixtmp ] ; then
16   amixer set PCM unmute &>/dev/null ; RC=$?
17   if [ -n "$DISPLAY" ] ; then
18     einfo "$UNMUT" ; eend $?
19       echo "$UNMUT" | \
20       osd_cat --delay=2 -c orange -A center -p middle -f "-misc-fixed-medium-r-normal-*-*-150-*-*-c-*-iso8859-15"
21   else
22     einfo "$UNMUT" ; eend $RC
23   fi
24   rm -f ~/.aumixtmp
25 else
26   touch ~/.aumixtmp
27   amixer set PCM mute &>/dev/null ; RC=$?
28   if [ -n "$DISPLAY" ] ; then
29     einfo "$MUT" ; eend $RC
30       echo "$MUT" | \
31       osd_cat --delay=2 -c orange -A center -p middle -f "-misc-fixed-medium-r-normal-*-*-150-*-*-c-*-iso8859-15"
32   else
33     einfo "$MUT" ; eend $RC
34   fi
35 fi
36
37 ## END OF FILE #################################################################