答案1
解决方案是禁用自动挂起:
- 打开GNOME 控制中心, 去力量tab (或者简单来说
gnome-control-center power
) - 在暂停和电源按钮放自动暂停, 到离开什么时候插入。
这将改变设置
$ dconf dump / | grep -i "suspend\|sleep"
sleep-inactive-ac-timeout=900
sleep-inactive-ac-type='suspend' # <
sleep-inactive-battery-timeout=900
$ gsettings list-recursively | grep -i "suspend\|sleep"
org.gnome.desktop.screensaver ubuntu-lock-on-suspend true
org.gnome.settings-daemon.plugins.power button-power 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 900
org.gnome.settings-daemon.plugins.power power-button-action 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend' # <
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
org.gnome.settings-daemon.plugins.power button-sleep 'hibernate'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 900
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
到
$ dconf dump / | grep -i "suspend\|sleep"
sleep-inactive-ac-timeout=900
sleep-inactive-ac-type='nothing' # <
sleep-inactive-battery-timeout=900
$ gsettings list-recursively | grep -i "suspend\|sleep"
org.gnome.desktop.screensaver ubuntu-lock-on-suspend true
org.gnome.settings-daemon.plugins.power button-power 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 900
org.gnome.settings-daemon.plugins.power power-button-action 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' # <
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
org.gnome.settings-daemon.plugins.power button-sleep 'hibernate'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 900
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
答案2
概括:
设置->电源:暂停:“关闭”
或者打开终端并执行命令:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
详细的:
使用设置对话框“电源”,将自动暂停设置为“关闭”。有时设置对话框中没有该设置;它只是缺失了。(例如,仅显示屏幕超时。)
那么请使用终端。
使用以下命令检查当前设置:
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
它应该答复:
'suspend'
请检查密钥是否可写:
gsettings writable org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
它应该答复:
true
检查范围:
gsettings range org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
它应该答复:
enum
'blank'
'suspend'
'shutdown'
'hibernate'
'interactive'
'nothing'
'logout'
并将值(“无”单引号、双引号或无引号)设置为您选择的值:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
之后检查设置是否已改变:
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
它应该显示你的更改:
'nothing'
提示:请避免使用 sudo 或 root shell,这将禁止访问本地设置。
答案3
需要补充的是,鉴于 GUI 控制中心似乎有无数个版本(我的版本看起来与上面的版本完全不同),我发现进行此更改的最简单方法是:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type "nothing"