[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

acpi scripts for Lenny on EeePC 701SD



Hello,

I'm trying to figure out which script should be called by acpi when the lid closes
on my EeePC 701SD netbook.

It's running Lenny and I keep it up to date with regular a dist-upgrade.

Under Gnome, closing the lid causes the machine to suspend, which is what I hope to
happen,

Under Fluxbox, with no gnome-power-manager running, the screen just blanks, not what
I'd like to happen.

Now I can see one solution would be to just run Gnome, another would be to run the
gnome-power-manager from .xinit or ~/.fluxbox/startup, but I'm hoping I can make
acpi do this for me without Gnome stuff.


dmesg seems to be telling me it's found the lib stitch here:

[    8.256170] ACPI: Lid Switch [LID]


So I had a look in proc and sure enough there it is:

$ cat /proc/acpi/button/lid/LID/state 
  state:      open


So I can see two events that trigger different scripts to do with the lid:

$ cat /etc/acpi/events/lid
  event=button/lid LID [^o]
  action=/etc/acpi/actions/lid.sh


$ cat /etc/acpi/events/lidbtn 
  # /etc/acpi/events/lidbtn
  # Called when the user closes or opens the lid

  event=button[ /]lid
  action=/etc/acpi/lid.sh


So as far as I can tell, it should be one of these:

  /etc/acpi/actions/lid.sh
  /etc/acpi/lid.sh


Now, I've added my own script to both locations, not knowing which one I'm
going to need and hoping that covering both would cover everything, but
it's just not working out for me.

Here is my simple script:

$ cat /etc/acpi/lid.sh
  #!/bin/sh

  grep -q closed /proc/acpi/button/lid/LID/state
  if [ $? = 0 ]
    then
    /usr/sbin/hibernate-ram
    fi
  done


But it's not getting called when I close the lid.

I did check that the lid sensor is being read with this simple script:

$ cat lidtest.sh 
  #!/bin/sh

  for i in {1..100}
    do
    grep -q open /proc/acpi/button/lid/LID/state
    if [ $? = 0 ]
      then
      echo Open
      fi

    grep -q closed /proc/acpi/button/lid/LID/state
    if [ $? = 0 ]
      then
      echo Closed
      fi
    done

Which reports Open when the lid is open, I close the lid while it's 
running and when I check back, it was reporting Closed when the lid was
closed.

So I don't think it's a problem with the lid sensor, it's just I can't
figure out why the scripts:

  /etc/acpi/actions/lid.sh
  /etc/acpi/lid.sh

Aren't being called.


Sorry I've rambled on a bit, I'm just a bit lost and hoping someone can
point me onto the right path.

Cheers.

-- 
Gav Ford
gav@revford.co.uk 
http://revford.co.uk 
I think we need to:  Attach the radar deflector


Reply to: