我正在使用带有 i3wm 的 Ubuntu 18.04,因此无法从 Gnome 访问设置菜单。
我正在使用一台笔记本电脑,它位于一个底座上,并连接了两个外接显示器。当笔记本电脑位于底座上时,盖子是关闭的。
问题是,一段时间后,笔记本电脑在不使用时会进入睡眠状态。无论盖子是打开还是关闭,都会发生这种情况。
我想改变这一点,使它在使用交流电源时永远不会进入睡眠状态,并且无论盖子是打开还是关闭,它都有外接显示器。
我需要编辑哪个配置文件?
答案1
我没有使用 I3 窗口管理器,但这些设置应该可以像 Unity 和 Gnome Desktop 一样为您工作。首先发现当前设置:
$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout
0
$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
'suspend'
如果您的第一个设置未0
将其设置为零,则不会测量不活动状态:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
如果您的第二个设置读为“暂停”,请将其设置为“无”:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
要列出所有设置,请使用:
$ gsettings list-recursively | grep -E 'sleep|suspend*'
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
org.gnome.settings-daemon.plugins.power power-button-action 'suspend'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor true
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 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
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'
org.gnome.desktop.screensaver ubuntu-lock-on-suspend true
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
org.gnome.settings-daemon.plugins.power power-button-action 'suspend'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor true
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 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
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'