wok view acpid/stuff/acpi/acpi_handler.sh @ rev 16000
lighttpd: fic typo in HOST_ARCH
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Mar 02 19:09:41 2014 +0100 (2014-03-02) |
parents | |
children |
line source
1 #!/bin/sh
2 # A script for handling ACPI events.
3 # See events/*.conf for a configuration file that can be used to
4 # run this script.
6 if [ $# != 1 ]; then
7 exit 1
8 fi
9 set $*
11 case "$1" in
12 button/lid)
13 [ -e /usr/sbin/pm-suspend ] && /usr/sbin/pm-suspend \
14 || logger "acpid: pm-suspend not found, skipping.." ;;
15 ac_adapter)
16 case "$2" in
17 AC*|AD*)
18 case "$4" in
19 00000000) # disconnected
20 [ -e /usr/sbin/pm-powersave ] \
21 && /usr/sbin/pm-powersave battery \
22 || logger "acpid: pm-powersave not found, skipping.." ;;
23 00000001) # connected
24 [ -e /usr/sbin/pm-powersave ] \
25 && /usr/sbin/pm-powersave ac \
26 || logger "acpid: pm-powersave not found, skipping.." ;;
27 esac ;;
28 esac ;;
29 *)
30 logger "acpid: action $1 $2 is not defined" ;;
31 esac