]> git.pld-linux.org Git - packages/acpid.git/blob - acpid.button.sh
02d7864256ae31e27f2b133e78cc403fd99e7d3f
[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                 #NUMBER=`printf "%d" "0x$4"`
35                 #EVEN=`dc -e "1 k $NUMBER 2 / p" | grep "\.0"`
36                 #if [ ! "$EVEN" ]; then
37                 #       logger "acpid: lid close action is not defined"
38                 #else
39                 #       logger "acpid: lid open action is not defined"
40                 #fi
41                 ;;
42         *)
43                 logger "acpid: $1 action is not defined"
44                 ;;
45 esac
This page took 0.063053 seconds and 2 git commands to generate.