]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.button.sh
- simpler odd/even check
[packages/acpid.git] / acpid.button.sh
1 #!/bin/sh
2 # /etc/acpid/actions/button.sh
3 #
4 # Detect buttons pressed and take appropriate actions.
5
6 if [ $# != 1 ]; then
7         exit 1
8 fi
9 set $*
10
11 case "$1" in
12         button/power)
13                 logger "acpid: $1 action is not defined."
14                 # halt computer
15                 #halt
16                 # put computer to sleep (not all machines have sleep button)
17                 #echo mem > /sys/power/state
18                 #hibernate
19                 ;;
20         button/sleep)
21                 logger "acpid: $1 action is not defined"
22                 # put computer to sleep
23                 #echo mem > /sys/power/state
24                 #hibernate
25                 ;;
26         button/lid)
27                 logger "acpid: $1 action is not defined"
28                 # put computer to sleep
29                 #echo mem > /sys/power/state
30
31                 # if you want to specify separate commands for
32                 # lid open/close uncomment this section:
33
34                 #ODD=`echo $4 | grep "1$\|3$\|5$\|7$\|9\|b$\|d$\|f$"`
35                 #if [ "$ODD" ]; then
36                 #       logger "acpid: lid close action is not defined"
37                 #else
38                 #       logger "acpid: lid open action is not defined"
39                 #fi
40                 ;;
41         *)
42                 logger "acpid: $1 action is not defined"
43                 ;;
44 esac
This page took 0.036525 seconds and 3 git commands to generate.