Open the Activities overview and start typing Tweaks. Click Tweaks to open the application. Select the General tab. Switch the Suspend when laptop lid is closed switch to off. Close the Tweaks window.
You could install dconf-editor to change what happens when lid is closed. Go to org., and gnome., and settings-daemon., and plugins. Power in dconf-editor. You can change the value of lid-close-ac-action and lid-close-battery-action for changing the action when lid closed. The possible values are ‘suspend’,’hibernate’,’logout’,’shutdown’,’nothing’.
How to change the action to take when laptop lid is closed?
Dconf editor offers options to change the action to take when the laptop lid is closed on AC or power, but it doesn’t work! So far as I know, you can edit the logind. Conf file to change the action. And it should work on all Ubuntu desktop, server, and flavors. 1.) Open terminal (press Ctrl+Alt+T on Gnome) from your system application menu.
How to suspend Ubuntu by closing the lid?
Go to System Settings and then click on Power. In the power setting, make sure that option for ‘When the lid is closed’ is set to Suspend. If you had a different setting here, you should check if you are able to suspend Ubuntu by closing the lid. If not, then follow the workaround in the next section.
To make Ubuntu do nothing when laptop lid is closed: Open the /etc/systemd/logind. Conf file in a text editor as root, for example, sudo -H gedit /etc/systemd/logind., and conf.
Make sure to enable suspend for lid close action. This is a no-brainer. You must make sure that you have the correct settings in place. Go to System Settings and then click on Power. In the power setting, make sure that option for ‘When the lid is closed’ is set to Suspend .
How do I lock the screen when the lid is closed?
Conf and set Handle, lid Switch=lock to lock the screen on lid close (but not suspend), or Handle, lid Switch=ignore to not even lock the screen. This is due to an upstream GNOME change.
For Ubuntu server without UI, use nano text editor instead. 2.) When the file opens, find out the line #Handle, lid Switch=suspend and change it to one of following : Handle, lid Switch=lock – lock when lid closed. , handle, lid Switch=ignore – do nothing.