diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-08-20 04:16:14 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-08-20 04:16:14 +0000 |
commit | 5080697e08033798fa496e259a34d12bf7df4056 (patch) | |
tree | bbeec22464b1d5138fde8f6ac3d0669477c22fe9 /sys-power/acpid/files | |
parent | cleanup (diff) | |
download | gentoo-2-5080697e08033798fa496e259a34d12bf7df4056.tar.gz gentoo-2-5080697e08033798fa496e259a34d12bf7df4056.tar.bz2 gentoo-2-5080697e08033798fa496e259a34d12bf7df4056.zip |
add some more helpful examples
Diffstat (limited to 'sys-power/acpid/files')
-rwxr-xr-x | sys-power/acpid/files/acpid-1.0.4-default.sh | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/sys-power/acpid/files/acpid-1.0.4-default.sh b/sys-power/acpid/files/acpid-1.0.4-default.sh index f7255d435f9e..566f3a03864c 100755 --- a/sys-power/acpid/files/acpid-1.0.4-default.sh +++ b/sys-power/acpid/files/acpid-1.0.4-default.sh @@ -1,26 +1,53 @@ #!/bin/sh -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/files/acpid-1.0.4-default.sh,v 1.1 2005/03/15 19:15:53 ciaranm Exp $ - +# /etc/acpi/default.sh # Default acpi script that takes an entry for all actions set $* group=${1/\/*/} action=${1/*\//} +device=$2 +id=$3 +value=$4 + +log_unhandled() { + logger "ACPI event unhandled: $*" +} case "$group" in button) case "$action" in - power) /sbin/init 0 - ;; - *) logger "ACPI action $action is not defined" + power) + /sbin/init 0 ;; + + # if your laptop doesnt turn on/off the display via hardware + # switch and instead just generates an acpi event, you can force + # X to turn off the display via dpms. note you will have to run + # 'xhost +local:0' so root can access the X DISPLAY. + #lid) + # xset dpms force off + # ;; + + *) log_unhandled $* ;; esac ;; - *) - logger "ACPI group $group / action $action is not defined" + ac_adapter) + case "$value" in + # Add code here to handle when the system is unplugged + # (maybe change cpu scaling to powersave mode) + #*0) + # ;; + + # Add code here to handle when the system is plugged in + # (maybe change cpu scaling to performance mode) + #*1) + # ;; + + *) log_unhandled $* ;; + esac ;; + + *) log_unhandled $* ;; esac |