you are viewing a single comment's thread
view the rest of the comments
[–] 28 points 7 months ago (4 children)

Disable suspend when the laptop lid is closed on a systemd-based GNU/Linux system:

sudo sed -i 's/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/g' /etc/systemd/logind.conf
sudo sed -i 's/#HandleLidSwitchExternalPower=suspend/HandleLidSwitchExternalPower=ignore/g' /etc/systemd/logind.conf
sudo systemctl restart systemd-logind

If you are in a TTY, you can blank the screen before closing the lid to prevent burn-in. After running this, come back later and press a key to turn the screen on again.

alias blankscreen='setterm --blank=force; read ans; setterm --blank=poke'

  • source
  • hideshow 4 child comments
  • [–] 2 points 7 months ago

    Came here to say this. All three of the major desktop operating systems have built-in controls to ignore the closing of the lid. Being forced to keep the lid open to keep a laptop on is a rookie workaround.

  • source
  • parent