如何防止外接显示器在系统空闲时关闭

如何防止外接显示器在系统空闲时关闭

当我使用笔记本电脑时,如果一段时间不使用,笔记本电脑的屏幕就会关闭,外接显示器也会自行关闭。我试图阻止我的第二台显示器关闭,并且我希望当系统进入空闲状态时,它在给定的时间内保持空白黑屏。

我正在通过连接 LCD 屏幕的 HDMI 电缆将第二个屏幕连接到我的笔记本电脑。我使用Debian 12(bookworm),我使用gnome-43.9桌面环境。我还使用 Wayland 窗口系统。

我尝试过xset s off,但没有任何影响。执行该命令时没有出现错误。

当我尝试时,xset -dpms我收到此错误消息:server does not have extension for -dpms option

我查找了类似的问题和其他 Stack Exchange 论坛,但找不到解决此问题的方法。

答案1

好的,首先,xset不执行任何操作的原因是因为它是仅适用于 x11 的命令。

其次,在 Wayland 上,你的合成器是控制你的屏幕的,所以你需要检查你的合成器。你说你在 GNOME 上,所以这意味着你必须编辑你的 GDM 配置。
使用 GDM 禁用显示器在空闲时关闭的方法是编辑/etc/gdm3/greeter.dconf-defaults并将其添加到其中:

# Automatic suspend
# =================
[org/gnome/settings-daemon/plugins/power]
# - Time inactive in seconds before suspending with AC power
#   1200=20 minutes, 0=never
sleep-inactive-ac-timeout=0
# - What to do after sleep-inactive-ac-timeout
#   'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing'
# sleep-inactive-ac-type='suspend'
sleep-inactive-ac-type='nothing'
# - As above but when on battery
# sleep-inactive-battery-timeout=1200
# sleep-inactive-battery-type='suspend'

相关内容