20

I have a SAMSUNG laptop, which by the experience in the last months, has been a great one. I am actually implementing some functionality to it, and since I noticed, I am able to wake up my laptop from sleep by just opening the lid on Windows 7, however, I need to press to power button to wake up in Ubuntu. Using a program called i-nex, I noted that the kernel DOES dettect a "lid switch", and I am looking forward to use it to wake up function. Any ideas?

enter image description here

UPDATE: Thanks @yossile for bringing up some clues! However, output of command cat /proc/acpi/wakeup does not show the LID device. I still tried the second set of commands you gave me with no effect. Then I tried experimenting, guessing that LID should be named by other value, so I tried enabling the others. No victory so far. But I noticed that devices that did not have any pci listings were disabled at all time no matter what I tried. Here is the output of command cat /proc/acpi/wakeup:

root@samsung:~# cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
PCE4      S4    *disabled  pci:0000:00:04.0
SBAZ      S4    *disabled  pci:0000:00:14.2
P0PC      S4    *disabled  pci:0000:00:14.4
GEC       S4    *disabled  
PE20      S4    *disabled  pci:0000:00:15.0
PE21      S4    *disabled  
PE22      S4    *disabled  pci:0000:00:15.2
PE23      S4    *disabled  
PWRB      S5    *enabled

So maybe it could be that LID is either GEC,PE21, or PE23?

Still, there is /proc/acpi/button/lid/LID/state file which shows that LID is opened. Any more ideas?

Braiam
  • 67,791
  • 32
  • 179
  • 269
  • does anything in this link help you? http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug#header-0 – fossfreedom Feb 08 '12 at 12:17
  • not at all, sleep is working on my laptop, i want to set the laptop switch status as "wake-up" when opened. but thanks! – crackout12 Feb 09 '12 at 00:46

2 Answers2

12

You can check whether the Lid open event is configured to wake up your OS by executing the cat /proc/acpi/wakeup command.
If the status of the 'LID' device is currently disabled you can try enabling it by executing:

sudo -s
echo "LID" > /proc/acpi/wakeup

This will set the status to enabled.
Running the commands again will set it back to disabled.

yossile
  • 5,728
  • This is exactly what I wanted thought to disable wakeup on opening the lid. Thanks. – Abhinav Sarkar Sep 23 '13 at 05:56
  • 7
    My /proc/acpi/wakeup didn't contain LID but LID0 instead. Thus echo "LID0" > /proc/acpi/wakeup did the trick. Thank you! – humkins Nov 20 '13 at 00:07
  • 5
    My /proc/acpi/ directory contains only button/lid/LID0 on my Sony VAIO (which wakes in Windows when opening the lid, but neither echoing LID or LID0 into wakeup gets the desired behavior. – Paul Lammertsma Jan 23 '15 at 20:46
  • 2
    If you want to do the opposite and disable wakeup on lid open, the echo "LID" > /proc/acpi/wakeup toggles from enabled to disable and back. And in my case as @gumkins mentions it was LID0 for me not LID – gene_wood Oct 29 '19 at 00:44
  • In my HP EliteBook 8460p, I have no LID option in this file :( – Liker777 Apr 20 '22 at 05:08
  • @gene_wood and yossile: thank you both! – pglpm Mar 04 '23 at 19:41
0

In my case, I also had to set in BIOS, to use sleep optimized for linux instead of windows.