【Ubuntu 休眠】设置合上笔记本盖子不休眠的方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaoxiao133/article/details/82847936

参考链接:

1、https://blog.csdn.net/thinktik/article/details/81044979

2、https://blog.csdn.net/canwang_sjtu/article/details/79305174

编辑下列文件:sudo gedit /etc/systemd/logind.conf
#HandlePowerKey按下电源键后的行为,默认power off
#HandleSleepKey 按下挂起键后的行为,默认suspend
#HandleHibernateKey按下休眠键后的行为,默认hibernate
#HandleLidSwitch合上笔记本盖后的行为,默认suspend(改为ignore;即合盖不休眠)在原文件中,还要去掉前面的#

然后将其中的:
#HandleLidSwitch=suspend
改成下面,记得去掉“#”号:
HandleLidSwitch=ignore

最后重启服务

service systemd-logind restart

注:在Ubuntu18.04和Ubuntu16.04笔记本电脑,下面测试可以使用。

猜你喜欢

转载自blog.csdn.net/xiaoxiao133/article/details/82847936