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

audacious-plugins: update TARBALL
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 30 09:14:06 2014 +0000 (2014-01-30)
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