disable_sleeping_when_close_laptop_lid.md

December 17, 2021 ยท View on GitHub

Disable sleeping when close the laptop lid

Tested on:

  • Ubuntu 18.04
  • Ubuntu 20.04

Command line method

  1. Add HandleLidSwitch=ignore to /etc/systemd/logind.conf:
$ sudo nano /etc/systemd/logind.conf
  1. Restart the logind service:
$ sudo systemctl restart systemd-logind

Alternative from Gnome GUI

  1. Install Gnome Tweak:
$ sudo apt-get install gnome-tweak-tool
  1. Disable lid action from Tweak > Power > Turn off (do nothing when lid is closed)