How to Change Ubuntu 13.10 Laptop Behavior When Lid is Closed

December 23, 2013 — 7 Comments

ubuntu laptop lid closed behavior


This tutorial shows you how to change Ubuntu 13.10 behavior to make it shutdown, hibernate, suspend or do nothing when your laptop lid is closed.

Ubuntu Unity provides a built-in utility allows to change lid closed behavior, but it only allows to suspend and do nothing in my Ubuntu 13.10 machine:

ubuntu lid closed setting

If you want to hibernate or shutdown, or you’re on Ubuntu Server without GUI follow the below steps:

1. Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to edit the config file:

sudo gedit /etc/systemd/logind.conf

For server edition, replace gedit with vi (Press i to start and Esc to exit editing, : followed by wq to save file.)

2. Find the line #HandleLidSwitch=suspend, remove the # and change it to:

  • HandleLidSwitch=poweroff to shutdown computer when lid is closed
  • HandleLidSwitch=hibernate to hibernate computer when lid is closed
  • HandleLidSwitch=ignore to do nothing

3. Save the file and restart the service or just restart your laptop to apply the changes.

sudo restart systemd-logind

That’s it. Enjoy!

I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to

7 responses to How to Change Ubuntu 13.10 Laptop Behavior When Lid is Closed

  1. Very clear and straight-forward instructions here. Thanks.

  2. Thank you! I was getting tired of opening my laptop to find a nearly drained battery. It is now properly suspending when shutting the lid.

  3. Thank You So MUCH!

  4. I works also on Ubuntu Server 14.04 – thanks!

  5. easy and efficient : thank you

  6. I tried the steps and changed HandleLidSwitch=hibernate but after restarting still I have no hibernating option, what I am seeing is the picture you showed above step one?? any comments? Thanks

Leave a Reply


Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>