Symlink notifyd.py to osd_server.py for backward compatibility
[grml-scripts.git] / usr_bin / XF86AudioMute
1 #!/bin/bash
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 ################################################################################
8
9 . /etc/grml/lsb-functions
10
11 UNMUT="Sound unmuted"
12 MUT="Sound muted"
13
14 if [ -f ~/.aumixtmp ] ; then
15   amixer set PCM unmute &>/dev/null ; RC=$?
16   if [ -n "$DISPLAY" ] ; then
17     einfo "$UNMUT" ; eend $?
18       echo "$UNMUT" | \
19       osd_cat --delay=2 -c orange -A center -p middle -f "-misc-fixed-medium-r-normal-*-*-150-*-*-c-*-iso8859-15"
20   else
21     einfo "$UNMUT" ; eend $RC
22   fi
23   rm -f ~/.aumixtmp
24 else
25   touch ~/.aumixtmp
26   amixer set PCM mute &>/dev/null ; RC=$?
27   if [ -n "$DISPLAY" ] ; then
28     einfo "$MUT" ; eend $RC
29       echo "$MUT" | \
30       osd_cat --delay=2 -c orange -A center -p middle -f "-misc-fixed-medium-r-normal-*-*-150-*-*-c-*-iso8859-15"
31   else
32     einfo "$MUT" ; eend $RC
33   fi
34 fi
35
36 ## END OF FILE #################################################################