3

I am using Ubuntu 16.04. I followed the steps in the given link to send my laptop to sleep on closing the lid.

Immediately lock screen when I close laptop lid under Gnome 3 (14.04)

It worked. But after few hours, when I opened the lid again, I saw that the laptop shutdown because of no battery at all. Although, it was 100% charged before the closing the lid. Can anyone help me in solving this problem?

2
  • 1
    Those instructions appear to be a "how to keep laptop running when closing lid and only lock the screen". Sep 30, 2016 at 17:28
  • @WinEunuuchs2Unix Oh! Thank You. I didn't see properly.
    – Siddhant
    Sep 30, 2016 at 18:17

2 Answers 2

6

Looking at the link you followed to lock the screen on lid close you need to follow these steps to have a regular suspend when the lid is closed.


Set Ubuntu Power Settings

From the Launcher select the cog for System Settings. Click the icon Power and this screen appears:

Power Suspend

Look at the line When lid is closed and set the options as they appear above to Suspend.

Close the window.


Set systemd logind.conf settings

Invoke the Terminal by pressing Ctrl+Alt+T. Edit the systemd logind.conf file by typing:

gksu gedit /etc/systemd/logind.conf

Look for these two lines and change them to look like this:

HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

You might have to change ignore or lock to read suspend. You might have to remove a leading #.

Save the file and quit gedit. After ensuring no applications (like word processor, spreadsheet, etc.) have files open type into the terminal:

sudo reboot

Voila! everything is reversed and your system will operate as you expect.

2
  • That was beautifully explained. +1 from me. Oct 1, 2016 at 4:25
  • no lid close option in settings on ubuntu 20.04 Jan 24, 2022 at 2:36
1

The link says that it is for locking the laptop on closing the lid. Therefore you locked the computer, got a blank screen and assumed it was sleeping. But, it was locked and still consuming power. If you want to send your laptop to sleep on closing the lid, then revert all your changes and follow the steps mentioned here:-

  • Go to System Settings and choose Power.
  • There, you will have the option of suspending the laptop on closing the lid when On battery and when When plugged in.
  • Choose Suspend for both of them.
8
  • Oh, I see. Can you help me in reverting the things? I am new to ubuntu.
    – Siddhant
    Sep 30, 2016 at 18:18
  • For that, I'll exactly have to know what you did. Did you follow the 1st answer completely in the link? Sep 30, 2016 at 18:21
  • Which answer did you follow, I'll answer accordingly. Sep 30, 2016 at 18:24
  • Yes I followed the first answer completely
    – Siddhant
    Sep 30, 2016 at 19:17
  • In the mean time click the cog in the top right corner and select 'suspend' before closing the lid. This will put your computer to sleep instead of the lid close lock can take place. Sep 30, 2016 at 19:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .