7

My laptop is broken and the lid does not lock. So I want it not to wake up when the lid is open. I use ubuntu, but gnome-power-preferences does not have any option like that (only to close the lid).

Is there any way to do this? I'm afraid next time it opens on the case it will get burned.

4 Answers 4

7

I found a way after googleing a bit smarter (it was difficult to find the correct search keys).

In short, the file /proc/acpi/wakeup has a line for LID which is enabled.

$ cat /proc/acpi/wakeup 
Device  S-state   Status   Sysfs node
PCIB      S4     disabled  pci:0000:00:1e.0
USB1      S3     disabled  pci:0000:00:1d.0
USB2      S3     disabled  pci:0000:00:1d.1
USB3      S3     disabled  pci:0000:00:1d.2
USB4      S3     disabled  pci:0000:00:1d.3
USB7      S3     disabled  pci:0000:00:1d.7
MODM      S3     disabled  
HDEF      S3     disabled  pci:0000:00:1b.0
PXS1      S4     disabled  pci:0000:02:00.0
LID       S4    *enabled   

If you echo " LID" > /proc/acpi/wakeup it will change to disable and the computer won't wake up on lid open.

Follow the instructions on the already mentioned link to set it permanent on your computer.

2
  • What if that file doesn't have that line? Can I just add it?
    – tim687
    Commented Mar 11, 2015 at 12:50
  • 1
    I'm getting bash: /proc/acpi/wakeup: Permission denied. What to do? (This is in LinuxMint 8.3)
    – Kanchu
    Commented Dec 8, 2017 at 8:28
2

I had a look at the BIOS parameters of my computer and found no "event at lid open" to configure. Using KDE on Debian, I found no such parameter in the main configuration window either. Moreover, my /proc/acpi/wakeup file does not include any LID line. So the previous answers do not work for all systems.

Nevertheless, setting up files based on this suggestion (and especially its corrected contents) may solve the problem for any Linux system.

I just advise to type the following line as root, and then try and close/open the lid after going to suspend mode, just to check that that solution works for your system before actually setting up the files:

echo disabled | sudo tee /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/power/wakeup

1
  • it also issues that screen (display) does not turn off, when closing lid. So it prevents all event triggering assigned to lid output
    – qba-dev
    Commented Mar 5 at 13:22
0

Usually wake is not triggered once lid is open. If you get running system once you open lid, your system was probably not in S3 sleep as it should have been. Probably there is something preventing full sleep.

Additionally you can look in BIOS for wake-up events and turn off those that you don't want (maybe lid wake is among them).

1
  • This is a fujitsu lifebook, I don't see nothing like this on the BIOS. I use the 'normal' suspend command from gnome-power-cmd.
    – chmeee
    Commented Nov 9, 2009 at 18:11
0

running echo " LID" > /proc/acpi/wakeup as root will disable it but to make it permanent you have to create a service so first cd to /etc/systemd/system/ then create file like your-service-name.service
then your file should be like this :

[Unit]
Description=no wakeup when lid is open

[Service]
ExecStart=/bin/bash -c '[ "$(cat /proc/acpi/wakeup |grep -P -o "LID.*\*\K\w+")" == "enabled" ] && echo "LID" > /proc/acpi/wakeup'

[Install]
WantedBy=multi-user.target
 

then Reload the service files to include the new service :

sudo systemctl daemon-reload

Start your service:

sudo systemctl start your-service-name.service

enable your service on every reboot:

sudo systemctl enable example.service
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jan 22, 2022 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .