Bloggings

Back

Closing laptop lid without suspend

2025-07-04

Looking into using a laptop as a home server

Since I've got a fibre connection I've been musing about not paying for a VPS and using a home server instead.

I have an unused laptop that could fit the bill maybe. The advantage of a laptop is that 1) I have one and 2) No need for a ups or screen.

I'm not really sure that I'll build a home server like this, but I'm collecting info.

One of the things I was wondering is how to stop the lapop from entering suspend when the lid is closed. I found a comment on unixstackexchange that explains how to do it on a non-systemd installation. (and a systemd one too but who cares about that?)

Find the path of the lid switch:

cat /proc/acpi/wakeup

Find the line for the lid and enter the command to deactivate it, for example:

echo 'PNP0C0D:00' | sudo tee /sys/bus/acpi/drivers/button/unbind

If it works, you can add the above line to /etc/rc.local to make it permanent.

Original comment

 


ยง