How to Change Ubuntu 13.10 Laptop Behavior When Lid is Closed

Last updated: December 23, 2013

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:

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 in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via Buy me a coffee:

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