If you use Ubuntu on a laptop, you might have noticed that the system is suspended when you close the lid.
That’s the expected behavior. It saves the battery as well as your work. You lift the lid, the system wakes up, and you can log in and continue your work.
That all sounds good except when you work with a multi-monitor setup. A few people, like me, prefer to have the laptop closed and only use the external monitor(s).
But if closing the laptop lid suspends the system, it creates a problem.
Let me show you how you can change this behavior.
Don’t suspend when laptop lid is closed
Actually, I have noticed that the recent versions of Ubuntu are smarter in this sense. When the laptop is connected to a docking station and you close the lid, it doesn’t go in suspend mode.
That’s the normal expected behavior but it may not work all the time for reasons known to Ubuntu gods.
The good thing is that you can force change this behavior using both GUI and command line.
Let me share both methods.
Method 1: Using GNOME Tweaks
If you are using the default GNOME desktop, you are in luck. Install GNOME Tweaks tool in Ubuntu from the software center or use this command:
sudo apt install gnome-tweaks
Once installed, start the Tweaks application. In the General tab from the sidebar, toggle off the ‘Suspend when laptop lid is closed’ button.