Skip to main content

Command Palette

Search for a command to run...

Keep your laptop up even when you close the lid on Linux

Updated
1 min read

TLDR: You just have to edit the file /etc/systemd/logind.conf.

$ sudo vi /etc/systemd/logind.conf # and the change the parameter to ignore

[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore # This option specifically is the default on Debian so if on your system did not modify that option you can just not write it 

$ sudo systemctl restart systemd-logind.service # Or reboot for the change to take effect

There are also a ton of other options in that file, so you can explore the content of the file just to have an idea of what you can do.

Resources:

  • https://wiki.debian.org/Suspend
  • https://www.alphr.com/keep-laptop-when-closed/

More from this blog

Mensah David Assigbi's personal IT blog

28 posts