One of the main means of save energy on our laptop is to adjust the behavior of the system when we lower the lid of the computer. At that moment we are not using the equipment and it may be a good idea to configure it appropriately to maximize the duration of our battery.
Learning how to configure the behavior of the notebook when lowering the lid it may not be as intuitive as we think. In Linux, we can make adjustments by modifying certain system files (with the risk that this entails) or use the tools that the desktop offers us to carry out the adjustments. In this article we show you how to carry it out in each case.
First of all, it is highly recommended to know what differences presents a suspended system versus one that is hibernated. This will allow us to know which of them best suits our needs. What's more, not all computers support the sleep state (either due to the capabilities of the motherboard itself or the lack of drivers), so in that case it would be of interest, perhaps, to keep the equipment active in case of closing the laptop lid.
Configure behavior from the desktop
To carry out the settings from the desktop, we will access the System settings > Energy and we will choose the option When closing the cover, which presents the two states that we have mentioned: Lay off o Do nothing.
Those users with more advanced knowledge may prefer to dig deeper into the system and manipulate the configuration files. For them, the following section is directed.
Configure behavior through system files
To adjust the system configuration when closing the lid of the equipment through the command line we must edit, with root privileges, the file logind.conf located on the route / etc / systemd /. To do this, we will write:
sudo nano /etc/systemd/logind.conf
Once inside the editor, we will look for the line that says # HandleLidSwitch = suspend, and we will remove the comment mark, also modifying the option suspends by hibernate if that is our preference.
4 comments, leave yours
Goodnight.
I want to know if it is possible to configure Ubuntu 16.04 that when lowering the lid of the laptop to turn off?
Thank you.
Have you tried modifying the /etc/systemd/login.conf file, as Luis says, changing the clause:
HandleLidSwitch = poweroff
?
What do I put if I don't want him to do anything?
sudo nano /etc/systemd/logind.conf
#HandleLidSwitch=ignore
That's how they close the lid and keep working for nothing...