wok diff acpid/stuff/acpi/acpi_handler.sh @ rev 25040

cups-filters: use standard c++14
author Hans-G?nter Theisgen
date Fri May 27 07:47:27 2022 +0100 (2022-05-27)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/acpid/stuff/acpi/acpi_handler.sh	Fri May 27 07:47:27 2022 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +#!/bin/sh
     1.5 +# A script for handling ACPI events.
     1.6 +# See events/*.conf for a configuration file that can be used to
     1.7 +# run this script.
     1.8 +
     1.9 +if [ $# != 1 ]; then
    1.10 +	exit 1
    1.11 +fi
    1.12 +set $*
    1.13 +
    1.14 +case "$1" in
    1.15 +	button/lid)
    1.16 +		[ -e /usr/sbin/pm-suspend ] && /usr/sbin/pm-suspend \
    1.17 +		|| logger "acpid: pm-suspend not found, skipping.." ;;
    1.18 +	ac_adapter)
    1.19 +		case "$2" in
    1.20 +		 AC*|AD*)
    1.21 +			case "$4" in
    1.22 +				00000000) # disconnected
    1.23 +					[ -e /usr/sbin/pm-powersave ] \
    1.24 +					&& /usr/sbin/pm-powersave battery \
    1.25 +					|| logger "acpid: pm-powersave not found, skipping.." ;;
    1.26 +				00000001) # connected
    1.27 +					[ -e /usr/sbin/pm-powersave ] \
    1.28 +					&& /usr/sbin/pm-powersave ac \
    1.29 +					|| logger "acpid: pm-powersave not found, skipping.." ;;
    1.30 +            esac ;;
    1.31 +		esac ;;
    1.32 +	*) 
    1.33 +		logger "acpid: action $1 $2 is not defined" ;;
    1.34 +esac