Ubuntu – Strange things happen when I close the laptop lid

power-managementUbuntu

I recently bought a new HP Spectre x360 laptop and installed Linux (Ubuntu 16.04 LTS 64 bit) for the first time.

I have noticed a few small bugs but something very strange happens when I shut the laptop lid. The last time I closed it for example, when I re-opened:

  • The screen resolution had changed to a setting I had had previously.
  • There were 5 untitled new folders on my desktop.
  • There were about 10 terminal windows opened.
  • The touchpad scrolling direction had reverted back to the default.
  • Chrome had disappeared from my toolbar when it was locked.
  • When I opened Chrome, it behaved like it was opened for the first time, and any extentions I had, had disappeared.

In summary, it seems like the machine had gone back in time — amongst other things.

I've also noticed previously that I've closed my lid with YouTube open, and it will start playing after I've closed it!

Is there a problem with my new laptop, or are these things bugs in my software? If it's the latter, is there anything I can do?

Best Answer

That certainly is very strange...

While I can't say what might have been the issue to cause something like that happening, one thing you could try to get around something like this happening is to have your computer ignore the lid being closed.

Edit /etc/systemd/logind.conf, and set:

HandleLidSwitch=ignore

Once you've updated and saved the file, you'll need to restart your logind.conf to have the changes actually take, which you do by running:

systemctl restart systemd-logind

Check out the man page for logind.conf for more info on what that file actually does.

Related Question