httptcnRc3ptul://www.175pt.com/d7flink/link.aspx?lid=21...

//Shutdown Ubuntu 14.04 LTS When The Lid Is Closed
Already upgraded to Ubuntu 14.04? Well, you may want to change your laptop behaviour when the lid is closed.
You can easily set the vaule to “Suspend” or “do nothing” in System Setting -> Power window. Here’s how to shutdown (or hibernate) Ubuntu when you close the lid of your laptop.
To get started:
1. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the command below to open the configuration file via gedit editor:
sudo gedit /etc/systemd/logind.conf
Replace gedit with vi or other text editor if you’re on Server edition.
2. Find out 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 changes.
sudo restart systemd-logind
Update: for Ubuntu 16.04, the command to restart the systemd service should be:
systemctl restart systemd-logind.service
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
or email to
Popular Posts
22 Sep , 2014
08 Jun , 2014
19 Jun , 2014
26 Apr , 2014
02 Jun , 2014
Related Posts
& Standard by 8BITPage not found | DealsList

参考资料

 

随机推荐