笔记本centos7合盖不休眠的设置方法

1,通过图形介面系统设置的power manager管理修改
2,通过修改相关配置文件
systemd 处理某些电源相关的 ACPI事件,可以通过从 /etc/systemd/logind.conf以下选项进行配置:
[root@mob systemd]# cat logind.conf

This file is part of systemd.

systemd is free software; you can redistribute it and/or modify it

under the terms of the GNU Lesser General Public License as published by

the Free Software Foundation; either version 2.1 of the License, or

(at your option) any later version.

Entries in this file show the compile time defaults.

You can change settings by editing this file.

Defaults can be restored by simply deleting this file.

See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
HandlePowerKey=poweroff
HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=lock
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=no

HandlePowerKey按下电源键后的行为,默认power off
HandleSleepKey 按下挂起键后的行为,默认suspend
HandleHibernateKey 按下休眠键后的行为,默认hibernate
HandleLidSwitch 合上笔记本盖后的行为,默认suspend

触发的行为可以有
ignore、power off、reboot、halt、suspend、hibernate、hybrid-sleep、lock 或 exec。
如果要合盖不休眠只需要把HandleLidSwitch选项设置为如下即可:
HandleLidSwitch=lock
注意:设置完成保存后运行下列命令才生效。
systemctl restart systemd-logind
3.将显示切到其它的非GUI环境下。

你可能感兴趣的:(linux-X)