![合上盖子时进入休眠状态](https://linux22.com/image/872024/%E5%90%88%E4%B8%8A%E7%9B%96%E5%AD%90%E6%97%B6%E8%BF%9B%E5%85%A5%E4%BC%91%E7%9C%A0%E7%8A%B6%E6%80%81.png)
我刚刚在我的 ThinkPad X1 Carbon - 20A7CTO1WW(第二代)上安装了 ubuntu 15.04(3.19.0-16-generic #16-Ubuntu)。
休眠功能在关闭盖子时有效(偶尔,不是所有时候),sudo pm-hibernate
但在关闭盖子时无效。在 14.04 上,我不得不修改 2 个文件才能使其工作,但现在它不再工作了。以下是在 14.04 上曾经有效的修改:
- 在
/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
:替换
[Disable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=no [Disable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=no
经过
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.lo
ResultActive=yes
- 在
/etc/systemd/logind.conf
:替换
#HandleLidSwitch=suspend
经过
HandleLidSwitch=hibernate