This post describes steps one can take to set laptop lid close behavior to ignore if the laptop lid or screen is closed in Ubuntu Linux.
Ubuntu Linux is configured to automatically suspend when the laptop lid is closed in order to save power. This feature has always been part of Ubuntu Linux platform but quite easy to disable so that when you close the laptop screen or lid, it doesn’t go to sleep.
When Ubuntu Linux goes to suspend mode, it’s not actually turned off – just gone to sleep. You can resume by opening the lid and your session will continue from where you left off.
When the action is set to do ignore, you can simply close the lid without putting the laptop to sleep while work is still being done.
How to keep laptop on when screen is closed in Ubuntu Linux
As described above, Ubuntu Linux will automatically suspend when you close the laptop lid to save power. You can change that do it doesn’t sleep, and below is how to do that.
To stop Ubuntu Linux from suspending when the lid is closed, follow these steps:
These instructions will only work if you are using systemd.
Press the CTRL + ALT + T keyboard shortcut to open the command console terminal.
The run the commands below:
sudo gedit /etc/systemd/logind.conf
Once the file opens, search for the line below:
Then change the line to:
Save the file and exit.
Next, run the commands below to apply your changes.
sudo systemctl restart systemd-logind.service
You can restart your computer and test to see if it works.
If not, continue below.
Alternatively, install Gnome Tweaks to help you control laptop lid close behavior in Ubuntu Linux.
Run the commands below to install.
sudo apt install gnome-tweaks
After installing the app, go to the Activities overview and search for Tweaks.
In the app, under General, toggle the switch to Off for Suspend when laptop lid is closed.
That should do it!
This post showed you how to configure Ubuntu Linux so that it doesn’t go to sleep when the laptop lid or screen is closed. If you find any error above or have something to add, please use the comment form below to report.