wok-current view acpid/stuff/acpi/acpi_handler.sh @ rev 22442
vlc: remove these deps -> did not help at all
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Mon Dec 23 15:27:45 2019 +0000 (2019-12-23) |
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