x220-acpi: Add acpi event scripts for Lenovo X220
[shutils.git] / lenovo-x220-linuxacpi / etc / acpi / default.sh
1 #!/bin/sh
2 # /etc/acpi/default.sh
3 # Default acpi script that takes an entry for all actions
4
5 set $*
6
7 group=${1%%/*}
8 action=${1#*/}
9 device=$2
10 id=$3
11 value=$4
12
13 log_unhandled() {
14 logger "ACPI event unhandled: $*"
15 }
16
17 case "$group" in
18 button)
19 case "$action" in
20 power)
21 /etc/acpi/actions/powerbtn.sh
22 ;;
23
24 # if your laptop doesnt turn on/off the display via hardware
25 # switch and instead just generates an acpi event, you can force
26 # X to turn off the display via dpms. note you will have to run
27 # 'xhost +local:0' so root can access the X DISPLAY.
28 #lid)
29 # xset dpms force off
30 # ;;
31
32 *) log_unhandled $* ;;
33 esac
34 ;;
35
36 ac_adapter)
37 case "$value" in
38 # Add code here to handle when the system is unplugged
39 # (maybe change cpu scaling to powersave mode). For
40 # multicore systems, make sure you set powersave mode
41 # for each core!
42 #*0)
43 # cpufreq-set -g powersave
44 # ;;
45
46 # Add code here to handle when the system is plugged in
47 # (maybe change cpu scaling to performance mode). For
48 # multicore systems, make sure you set performance mode
49 # for each core!
50 #*1)
51 # cpufreq-set -g performance
52 # ;;
53
54 *) log_unhandled $* ;;
55 esac
56 ;;
57
58 *) log_unhandled $* ;;
59 esac