update(debian12-disable-sleep)

This commit is contained in:
mei 2025-05-04 15:14:04 +08:00
parent ae247dbe4d
commit f74876a0ef

View File

@ -1,15 +1,37 @@
## 合上笔记本盖子不休眠
1. 编辑 `/etc/systemd/logind.conf`
2. 找到 `#HandleLidSwitch` 这一行意思是合上笔记本上盖后的行为默认suspend修改为ignore即合盖不休眠。然后还要去掉前面的#。保存文件。
3. 重启systemd服务
1. 编辑 `/etc/systemd/logind.conf`
2. 找到 `#HandleLidSwitch` 这一行意思是合上笔记本上盖后的行为默认suspend修改为ignore即合盖不休眠。然后还要去掉前面的#。保存文件。
3. 重启systemd服务
```shell
service systemd-logind restart
```
## 关闭屏幕
1. 安装vbetool软件apt-get install vbetool
2. 关闭显示器:`vbetool dpms off`
1. 安装vbetool软件apt-get install vbetool
2. 关闭显示器:`vbetool dpms off`
打开显示器:`vbetool dpms on`
## 禁用休眠
```shell
mkdir -p /etc/systemd/sleep.conf.d/
touch /etc/systemd/sleep.conf.d/nosuspend.conf
```
nosuspend.conf
```nosuspend.conf
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
```
## 参考资料
[用笔记本作为PVE服务器如何关闭屏幕以节电](https://blog.csdn.net/William_Lee1333/article/details/128095617)
[用笔记本作为PVE服务器如何关闭屏幕以节电](https://blog.csdn.net/William_Lee1333/article/details/128095617)
[在 Debian 12 上禁用自动工作站睡眠](https://synay.net/zh/support/kb/disabling-automatic-workstation-sleep-debian-12)