Linux

Run laptop with the lid closed

Published on

Edit the /etc/systemd/logind.conf file, and change the following lines:

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

Then restart the service:

sudo systemctl restart systemd-logind.service

Turn off laptop screen automatically

Published on

Edit the /etc/default/grub file adding the following to the GRUB_CMDLINE_LINUX variable:

GRUB_CMDLINE_LINUX="consoleblank=300"  # turn off the screen after 5 minutes

Then update grub:

sudo update-grub