wok-next annotate acpid/stuff/acpi/acpi_handler.sh @ rev 14926

enna: add old default type for edc files.
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 07 13:00:15 2013 +0000 (2013-08-07)
parents
children
rev   line source
domcox@12208 1 #!/bin/sh
domcox@12208 2 # A script for handling ACPI events.
domcox@12208 3 # See events/*.conf for a configuration file that can be used to
domcox@12208 4 # run this script.
domcox@12208 5
domcox@12208 6 if [ $# != 1 ]; then
domcox@12208 7 exit 1
domcox@12208 8 fi
domcox@12208 9 set $*
domcox@12208 10
domcox@12208 11 case "$1" in
domcox@12208 12 button/lid)
domcox@12208 13 [ -e /usr/sbin/pm-suspend ] && /usr/sbin/pm-suspend \
domcox@12208 14 || logger "acpid: pm-suspend not found, skipping.." ;;
domcox@12208 15 ac_adapter)
domcox@12208 16 case "$2" in
domcox@12208 17 AC*|AD*)
domcox@12208 18 case "$4" in
domcox@12208 19 00000000) # disconnected
domcox@12208 20 [ -e /usr/sbin/pm-powersave ] \
domcox@12208 21 && /usr/sbin/pm-powersave battery \
domcox@12208 22 || logger "acpid: pm-powersave not found, skipping.." ;;
domcox@12208 23 00000001) # connected
domcox@12208 24 [ -e /usr/sbin/pm-powersave ] \
domcox@12208 25 && /usr/sbin/pm-powersave ac \
domcox@12208 26 || logger "acpid: pm-powersave not found, skipping.." ;;
domcox@12208 27 esac ;;
domcox@12208 28 esac ;;
domcox@12208 29 *)
domcox@12208 30 logger "acpid: action $1 $2 is not defined" ;;
domcox@12208 31 esac