Call cat /proc/acpi/wakeup
. This will look like this:
Device S-state Status Sysfs node
LID S4 *enabled platform:PNP0C0D:00
SLPB S3 *enabled platform:PNP0C0E:00
IGBE S4 *disabled pci:0000:00:19.0
EXP2 S4 *enabled pci:0000:00:1c.1
EXP3 S4 *disabled
XHCI S3 *enabled pci:0000:00:14.0
EHC1 S3 *enabled pci:0000:00:1d.0
EHC2 S3 *enabled pci:0000:00:1a.0
By writing i.e. LID
to this file you can change the status:
root@machine # echo 'LID' >> /proc/acpi/wakeup
If you call cat
again like before, you will see, that LID
is *disabled
now. Writing LID
again to it, enables it again. The change is immediate.
Unfortunately, this change is not permanent. For this purpose, you can create a shell script, which is executed every time you start up your computer:
Make a new file, i.e.
root@machine # nano disableWakeup.sh
Paste this content into it
result=$(cat /proc/acpi/wakeup | grep 'enabled' | grep -o $1)
if [ "$result" != "" ]
then
echo "$result is enabled"
echo $1 >> /proc/acpi/wakeup
echo "Disabled $1"
fi
Now, you have to make this file executable
root@machine # chmod 755 disableWakeup.sh
After this you can call the script by ./disableWakeup.sh LID
. This disables wakeup by LID-Switch. But you can replace LID
by any other trigger, i.e. ./disableWakeup.sh EHC1
.
To execute it automatically, there are different ways, described here, here and here, also others. I prefer adding a line at the end of the file /etc/bash.bashrc
/location/of/the/scrip/i.e./opt/loginScript/disableWakeup.sh
This is then called every time, you open a shell. More often than needed, but it works.