wok-current annotate acpid/stuff/acpi/button.sh @ rev 6265
Up: gutenprint, gutenprint-dev to 5.2.6.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Tue Sep 14 14:42:29 2010 +0000 (2010-09-14) |
parents | |
children |
rev | line source |
---|---|
domcox@1624 | 1 #!/bin/sh |
domcox@1624 | 2 # button.sh - Managing button events for SliTaz |
domcox@1624 | 3 # |
domcox@1624 | 4 |
domcox@1624 | 5 source /etc/acpi/key-constants |
domcox@1624 | 6 |
domcox@1624 | 7 # logger "button.sh: event=$1" |
domcox@1624 | 8 |
domcox@1624 | 9 # take care about the way events are reported |
domcox@1624 | 10 |
domcox@1624 | 11 EVENT_TYPE=`echo $1 | cut -d/ -f1` |
domcox@1624 | 12 if [ $EVENT_TYPE = $1 ]; then |
domcox@1624 | 13 EVENT=$2 |
domcox@1624 | 14 else |
domcox@1624 | 15 EVENT=`echo "$1" | cut -d/ -f2` |
domcox@1624 | 16 fi |
domcox@1624 | 17 |
domcox@1624 | 18 case $EVENT in |
domcox@1624 | 19 power) |
domcox@1624 | 20 logger "Event: button/power - sending KEY_EXIT($KEY_EXIT)" |
domcox@1624 | 21 /usr/bin/acpi_fakekey $KEY_EXIT |
domcox@1624 | 22 ;; |
domcox@1624 | 23 lid) |
domcox@1624 | 24 if [ -e /usr/bin/suspend ] ; then |
domcox@1624 | 25 logger "Event: button/lid - suspending" |
domcox@1624 | 26 /usr/bin/suspend |
domcox@1624 | 27 else |
domcox@1624 | 28 logger "Event: button/lid - /usr/bin/suspend not found, skipping.." |
domcox@1624 | 29 fi |
domcox@1624 | 30 ;; |
domcox@1624 | 31 sleep) |
domcox@1624 | 32 if [ -e /usr/bin/hibernate ] ; then |
domcox@1624 | 33 logger "Event: button/sleep - hibernating" |
domcox@1624 | 34 /usr/bin/hibernate |
domcox@1624 | 35 else |
domcox@1624 | 36 logger "Event: button/sleep - /usr/bin/hibernate not found, skipping.." |
domcox@1624 | 37 fi |
domcox@1624 | 38 ;; |
domcox@1624 | 39 esac |