How to configure the behavior of the laptop when lowering the lid

dell ubuntu

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.

suspension panel

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.

nano hibernate

 Then we will save the changes and restart the computer in order to check the effects. From now on, our laptop will execute any of the options that we have indicated when we close its lid.
Source: ubuntuconjavi.

4 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   adrian said


    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.

    1.    Antonio said

      Have you tried modifying the /etc/systemd/login.conf file, as Luis says, changing the clause:

      HandleLidSwitch = poweroff


  2.   Davo said

    What do I put if I don't want him to do anything?

  3.   Juan said

    sudo nano /etc/systemd/logind.conf
    That's how they close the lid and keep working for nothing...