LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   ACPI events (http://www.linuxquestions.org/questions/slackware-14/acpi-events-594269/)

Lockywolf 10-24-2007 02:08 PM

ACPI events
 
Hi all.

I have HP-Compaq 6710s laptop

wWho can advice any acpi scripts for slackware to supend it via s2ram (uswsusp) when the lid is closed, switch governors when adapter is present|is not present, etc...

I looked at ubuntu scripts, but they seem to be ubuntu-specific.

rworkman 10-24-2007 02:18 PM

Here is what I have for s2ram on lid close.
Note that I've also got a custom modification to my rc.S and rc.6 scripts to remove/create /etc/powerdown file when halt/reboot occurs - I'm impatient, and I often shutdown the system and immediately close the lid. This ugly hack prevents that from occurring. :-)

Code:

root@liberty:~# cat /etc/acpi/events/lid
event=button/lid.*
action=/etc/acpi/actions/lid.sh %e

Code:

root@liberty:~# cat /etc/acpi/actions/lid.sh
#!/bin/sh

# Suspend to ram when the lid is closed

# First, let's make sure we're not shutting down or rebooting
if [ ! -e /etc/powerdown ]; then
  sync ; sync # Just in case...
  echo -n mem > /sys/power/state
fi



All times are GMT -5. The time now is 08:30 AM.