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
    Possible duplicate of http://askubuntu.com/questions/122856/dont-want-to-suspend-when-closing-lid or here http://askubuntu.com/questions/122250/doesnt-suspend-when-closing-lid – LnxSlck Aug 04 '12 at 13:04
  • The second possible duplicate link doesn't have answers. – Peachy Aug 04 '12 at 14:01

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
  • 6,947
  • 5
  • 37
  • 51
  • Unfortunately that didn't help. I've updated my question with results. – Yuri Aug 05 '12 at 12:36
  • I am not sure you are looking at the right file ...

    could you do a find /proc and post it somewhere ? (a good place to put it might be http://textsave.de )

    – josinalvo Jan 05 '13 at 16:20
  • also, if you could point to the full path file you are reading, it would be nice – josinalvo Jan 05 '13 at 16:22
  • @yuri

    please give us a bit more information (as described in my previous comments)

    – josinalvo Jan 07 '13 at 03:11
  • Sorry for not checking in in a while. The full path is: /proc/acpi/button/lid/C1CF/state The output for 'find /proc' is here: http://textsave.de/?p=153599 Do you want me to add it to the question? – Yuri Jan 08 '13 at 14:46
  • @yuri sorry, but I cant see the text ... is the link working properly ? – josinalvo Jan 09 '13 at 11:41
  • I think it exceeds some limit on textsave.de. It's 71937 lines! Same on pastebin.com, and on friendpaste.com loading the page with the paste almost crashed my browser! I could try a few more, but I'm not sure it would help. – Yuri Jan 09 '13 at 18:23
  • you are right. I wanted to examine it to see if there was any other possible file that was reporting the lid state correctly, but /proc/acpi/button/lid/C1CF/state seems to be the right place to look =( – josinalvo Jan 10 '13 at 13:59
  • Ah well. Tell me if you have any more ideas. I've kind of learned to live with it, now. All the same, it would be nice to have everything working properly. – Yuri Jan 11 '13 at 21:11
  • You might be interested in: – josinalvo Jan 13 '13 at 17:30
  • https://bugzilla.redhat.com/show_bug.cgi?id=512958 – josinalvo Jan 13 '13 at 17:31
  • 1
    https://bugs.launchpad.net/ubuntu/+source/acpid/+bug/1037860 – josinalvo Jan 13 '13 at 17:32