0

I have an HP 510 laptop with Ubuntu 12.04.
I have all the correct settings for suspending when the lid is closed, as far as I can tell, so I think it's a problem with detecting the event.
The way it "should" be detected, from what I can see, is a little hardware switch that is pushed when the lid closes. This switch manually puts off the backlight, and sends the suspend signal. All I can think is that the signal isn't being properly interpreted.

Can anyone suggest a fix?

Update:
I tested whether the button was actually working based on the suggestion by josinalvo, and I found that in the directory /proc/acpi/button/lid/ there is no LID directory. There is, however, a C1CF folder, and in it is a state file. When using the this file instead of LID, I discovered that, no, when I close the lid, the state does not change. The full path is: '/proc/acpi/button/lid/C1CF/state

Update 2 I'm now running Xubuntu 12.10, (Unity was to slow) but I still have the same problem.

Yuri
  • 21

1 Answers1

4

To know if the button is indeed working, go to a terminal and type

while [ 1 ]; do cat /proc/acpi/button/lid/LID/state; sleep 1; done

you should get one

state:      open

every second. Now close the lid and wait a bit. Open it again. Some lines should now be

state:      closed

with that, you can tell that the hardware is working, and the signal is read by linux


If it is working, well, I have no idea what your problem is =P

However, I have an ugly kludge you can use while your problem is not fixed

#ensures that a closed lid causes the computer to suspend
#! /bin/bash

while [ 1 ]
do
sleep 20
grep closed /proc/acpi/button/lid/LID/state && sudo pm-suspend
done

This is a bash script.

To use it,

1) create a file with these contents (say, check_lid)
2) right click the file, and open properties
2.1) go to permissions, and select 'allow executing file as a program'
3) on the shutdown menu, go to Startup Applications and add your program (check_lid) to the programs in startup
4) Ensure that your user can run sudo pm-suspend without using a password (via the sudoers file)

josinalvo
  • 7,017