archrelease: copy trunk to community-any
[arch-community.git] / acpid / repos / community-x86_64 / handler.sh
blobbab144d035e71008e976e809d5f0c6443949e708
1 #!/bin/bash
2 # Default acpi script that takes an entry for all actions
4 case "$1" in
5 button/power)
6 case "$2" in
7 PBTN|PWRF)
8 logger 'PowerButton pressed'
9 ;;
11 logger "ACPI action undefined: $2"
13 esac
15 button/sleep)
16 case "$2" in
17 SLPB|SBTN)
18 logger 'SleepButton pressed'
21 logger "ACPI action undefined: $2"
23 esac
25 ac_adapter)
26 case "$2" in
27 AC|ACAD|ADP0)
28 case "$4" in
29 00000000)
30 logger 'AC unpluged'
32 00000001)
33 logger 'AC pluged'
35 esac
38 logger "ACPI action undefined: $2"
40 esac
42 battery)
43 case "$2" in
44 BAT0)
45 case "$4" in
46 00000000)
47 logger 'Battery online'
49 00000001)
50 logger 'Battery offline'
52 esac
54 CPU0)
56 *) logger "ACPI action undefined: $2" ;;
57 esac
59 button/lid)
60 case "$3" in
61 close)
62 logger 'LID closed'
64 open)
65 logger 'LID opened'
68 logger "ACPI action undefined: $3"
70 esac
73 logger "ACPI group/action undefined: $1 / $2"
75 esac
77 # vim:set ts=4 sw=4 ft=sh et: