Created
March 29, 2009 13:41
-
-
Save ursm/87398 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # /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 | |
| ;; | |
| lid) | |
| lid_uid=$(hal-find-by-property --key button.type --string lid) | |
| lid_closed=$(hal-get-property --key button.state.value --udi ${lid_uid}) | |
| case "$lid_closed" in | |
| true) | |
| /usr/sbin/pm-suspend | |
| ;; | |
| false) | |
| logger "lid open." | |
| ;; | |
| *) log_unhandled $* ;; | |
| esac | |
| ;; | |
| *) log_unhandled $* ;; | |
| esac | |
| ;; | |
| ac_adapter) | |
| case "$value" in | |
| *0) | |
| xbacklight -display ":0.0" -set 50 | |
| ;; | |
| *1) | |
| xbacklight -display ":0.0" -set 100 | |
| ;; | |
| *) log_unhandled $* ;; | |
| esac | |
| ;; | |
| *) log_unhandled $* ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment