If you’re running Ubuntu 13.10 Saucy on laptop, you may already find that the power settings only allows you to suspend or do nothing when laptop lid is closed.
What if we want to shutdown or hibernate laptop when lid is closed? Well, this tutorial is going to show you how to do it.
To get started, press Ctrl+Alt+T on your keyboard to open terminal window for running commands. When it opens, copy and paste below command and hit run to edit the config file with root privilege:
sudo gedit /etc/systemd/logind.conf
Note that you need to type in user password (terminal display nothing when typing password, type in mind and hit enter to get pass).
Then find out the line said:
change it into:
Save the file and then restart the service via below command to apply changes (or just restart).
sudo restart systemd-logind
Replace poweroff with hibernate will make your laptop hibernate when lid is closed.