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

updated shaarli again (0.10.3 -> 0.11.1)
author Hans-G?nter Theisgen
date Fri Oct 04 13:29:43 2019 +0100 (2019-10-04)
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