How do I keep my laptop screen on while the lid is closed?

Want closing your ubuntu linux laptop lid to do nothing for some reason?

Me too. Here’s how:

For the purposes of this document, we’re working with Ubuntu, but should work for most Debian based linux distros.

Edit /etc/systemd/logind.conf

sudo vim /etc/systemd/logind.conf

find or add this line, make sure it’s not commented:

HandleLidSwitch=ignore

save and reboot.

Now, closing the lid will ignore the status of the lid switch, and the laptop will not shut down, or change displays. It’s great for reusing an old laptop headless, or on an external monitor like we do on the Arcade Cabinet.

Sometimes it runs hotter this way, make sure it can breathe!