Preventing laptop wake up when opening the lid on linux

Solution 1:

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.

Solution 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