All changes will be performed in /etc/systemd/logind.conf
configuration file.
- Open configuration file in preferred editor:
sudo nano /etc/systemd/logind.conf
- Uncomment and change
HandleLidSwitch*
actions according your needs:HandleLidSwitch=poweroff
- shutdown when lid is closed.HandleLidSwitch=hibernate
- hibernate when lid is closed.HandleLidSwitch=ignore
- do nothing.HandleLidSwitch=suspend
- suspend when lid is closed.