How to Make Your Ubuntu 21.10 PC Never Go to Sleep

转自 How to Make Your Ubuntu 21.10 PC Never Go to Sleep - FOSTips

How to Keep Ubuntu Notebook from Sleeping Even When Lid Closed:

For notebook users, Ubuntu will go to sleep when the lid is closed even you disabled automatic suspend in Settings.

To ignore the lid close action, press Ctrl+Alt+T on keyboard to open a terminal window and run command to edit the configuration file:

sudo gedit /etc/systemd/logind.conf

When the file opens, remove “#” at the beginning of the line: “#HandleLidSwitch=suspend”. And change the value to “ignore”, so the line will be: HandleLidSwitch=ignore.

Save the file and it will take effect in next boot. Or run systemctl restart systemd-logind.service command to restart the service, though it logged me out and refused to login again in my case!

NOTE: For choice, you may set "HandleLidSwitchExternalPower=ignore" for the behavior when on AC power, or use "HandleLidSwitchDocked=ignore" if more than one display is connected. And use 'lock' to lock screen when lid close may be a good choice.

That’s all. Enjoy!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值