Ubuntu disable sleep on lid close

Ubuntu disable sleep on lid close

I prefer to install Ubuntu Desktop version instead of Ubuntu Server version because it takes care of all the drivers for my laptop. After the installation I’ll disable the GUI.

The screen will stay on at the login prompt and since it is a laptop, there isn’t a power off for the monitor only. Closing the lid will cause the laptop to sleep.

To prevent it from going to sleep. Do these.

ubuntu-disable-sleep-on-lid-close

Uncomment the 2 lines below and set it to ignore.

ubuntu-disable-sleep-on-lid-close

Lastly restart the service.

sudo service systemd-logind restart