wok view acpid/stuff/acpi/acpi_handler.sh @ rev 18072

djvulibre, djview: fix bad value of $SF_MIRROR, use downloads (may mix html+binary data with busybox wget)
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Thu May 21 16:13:49 2015 +0200 (2015-05-21)
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