[ACPI-sppt] acpi power event
Jack Coates <[email protected]>
| Newsgroups | gmane.linux.acpi.support |
|---|---|
| Organization | Monkeynoodle.Org |
| Message-ID | <[email protected]> |
not sure when this stopped working now...
[Wed Jun 11 14:18:35 2003] received event "ac_adapter ACAD 00000080
00000000"
[Wed Jun 11 14:18:35 2003] completed event "ac_adapter ACAD 00000080
00000000"
...
[Wed Jun 11 14:18:38 2003] received event "ac_adapter ACAD 00000080
00000001"
[Wed Jun 11 14:18:38 2003] completed event "ac_adapter ACAD 00000080
00000001"
/etc/acpi/events/power :
# change screen brightness and CPU speed
event=ac_adapter.*
action=/etc/acpi/actions/powerchange
# shut down when power button is pressed
event=button/power.*
action=/usr/local/sbin/halt-dialog
/etc/acpi/actions/powerchange
#!/bin/sh
status=`sed "s/state: *//" /proc/acpi/ac_adapter/ACAD/state`
case $status in
"on-line" ) /usr/bin/spicctrl -b 255
exit 0
;;
"off-line" ) /usr/bin/spicctrl -b 100
exit 0
;;
esac
echo "Something bad happened!"
exit 1
The power button > halt-dialog thing works nicely. If I run
/etc/acpi/actions/powerchange manually, it works properly. But it
doesn't catch the event on a regular basis. Is there a typo in
/etc/acpi/events/power that I'm just not seeing?
thanks,
--
Jack Coates
Monkeynoodle: A Scientific Venture...
http://www.monkeynoodle.org/resume.html
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5