~ubuntu-branches/ubuntu/maverick/vlock/maverick

« back to all changes in this revision

Viewing changes to scripts/alsa_mute.sh

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2008-06-17 17:13:25 UTC
  • mfrom: (1.2.1 upstream) (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20080617171325-bahnx12opiygdsys
* Don't try to chgrp to "vlock" during build time (Closes: #486665)
* Bump standards version (No changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# alsa_mute.sh -- alsa muting script for vlock,
 
3
#                 the VT locking program for linux
 
4
 
5
# This program is copyright (C) 2007 Frank Benkstein, and is free software.  It
 
6
# comes without any warranty, to the extent permitted by applicable law.  You
 
7
# can redistribute it and/or modify it under the terms of the Do What The Fuck
 
8
# You Want To Public License, Version 2, as published by Sam Hocevar.  See
 
9
# http://sam.zoy.org/wtfpl/COPYING for more details.
 
10
 
 
11
set -e
 
12
 
 
13
DEPENDS="all"
 
14
 
 
15
hooks() {
 
16
  while read hook_name ; do
 
17
    case "${hook_name}" in
 
18
      vlock_start)
 
19
        amixer -q set Master mute
 
20
      ;;
 
21
      vlock_end)
 
22
        amixer -q set Master unmute
 
23
      ;;
 
24
    esac
 
25
  done
 
26
}
 
27
 
 
28
if [ $# -ne 1 ] ; then
 
29
  echo >&2 "Usage: $0 <command>"
 
30
  exit 1
 
31
fi
 
32
 
 
33
case "$1" in
 
34
  hooks)
 
35
    hooks
 
36
  ;;
 
37
  preceeds)
 
38
    echo "${PRECEEDS}"
 
39
  ;;
 
40
  succeeds)
 
41
    echo "${SUCCEEDS}"
 
42
  ;;
 
43
  requires)
 
44
    echo "${REQUIRES}"
 
45
  ;;
 
46
  needs)
 
47
    echo "${NEEDS}"
 
48
  ;;
 
49
  depends)
 
50
    echo "${DEPENDS}"
 
51
  ;;
 
52
  conflicts)
 
53
    echo "${CONFLICTS}"
 
54
  ;;
 
55
  *)
 
56
    echo >&2 "$0: unknown command '$1'"
 
57
    exit 1
 
58
  ;;
 
59
esac