]>
Commit | Line | Data |
---|---|---|
6af9fa45 | 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 | ||
b0b26b42 | 31 | # if you want to specify separate commands for |
32 | # lid open/close uncomment this section: | |
6af9fa45 | 33 | |
2abba283 | 34 | #ODD=`echo $4 | grep "[13579bdf]$"` |
3155fdaf | 35 | #if [ "$ODD" ]; then |
6af9fa45 | 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 |