Kiến Thức Linux

Ubuntu 15.04: Auto Shutdown/Hibernate When Lid Closed

Ubuntu Laptop Lid behavior

Ubuntu Laptop Lid behavior

For laptop users, Ubuntu desktop only provide options “Suspend” and “Do Nothing” in its Power settings to act when the lid is closed.

If you want your laptop automatically shutdown or hibernate when you close the lid, just do below steps:

1. Open terminal from the Dash or by pressing Ctrl+Alt+T on keyboard. When it opens, run below command to edit the configuration file:

gksudo gedit /etc/systemd/logind.conf

Install gksu via Ubuntu Software Center if the command doesn’t work.

When the file opens, add one of below lines into the end and click save.

  • HandleLidSwitch=hibernate – to hibernate when lid closed
  • HandleLidSwitch=poweroff – to shutdown when lid closed

auto-shutdown-hibernate

2. After saved the file, restart systemd-logind service to apply the changes. To do so, run command:

sudo service systemd-logind restart

Finally close your laptop lid and see effect.

Đăng ký liền tay Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !

Add Comment

Click here to post a comment

Đăng ký liền tay
Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !