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 closedHandleLidSwitch=hibernate
to hibernate computer when lid is closedHandleLidSwitch=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!
Very clear and straight-forward instructions here. Thanks.
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.
Thank You So MUCH!
I works also on Ubuntu Server 14.04 – thanks!
easy and efficient : thank you
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
James
You won’t see the hibernate option in the Power settings. Just closed your lid and Laptop should go hibernate. If not, make sure you have the feature enabled:
http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/