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

本文详细介绍了如何在Linux系统中通过图形界面和编辑配置文件来管理电源设置,包括使用systemd-logind服务处理电源相关的ACPI事件,如修改电源键、挂起键、休眠键及合盖行为。

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环境下。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值