更改关机确认计时器

caw*_*wot 5 gnome shutdown 18.04

我想更改“系统将在 60 秒后自动关闭”对话框中的计时器。我设备上的电池在收到这条消息大约 30 秒后没电了。

在通常的地方(gsettings、dconf、系统设置等)似乎没有这个设置。

我对删除此对话框或更改关闭行为不感兴趣,我只想更改它等待的时间。

Rin*_*ind 4

备注:点击关闭选项两次将忽略计时器并关闭计时器。这可能是您的另一种选择。

/etc/acpi/powerbtn.sh
Run Code Online (Sandbox Code Playgroud)

重要部分:

# If the current X console user is running a power management daemon that
# handles suspend/resume requests, let them handle policy This is effectively
# the same as 'acpi-support's '/usr/share/acpi-support/policy-funcs' file.

[ -r /usr/share/acpi-support/power-funcs ] && getXconsole
PMS="gnome-settings-daemon kpowersave xfce4-power-manager"
PMS="$PMS guidance-power-manager.py dalston-power-applet"
PMS="$PMS mate-settings-daemon"
PMS="$PMS unity-settings-daemon"
Run Code Online (Sandbox Code Playgroud)

您可能有更多选项(我检查了 16.04.4 服务器)它有几个选项来测试不同的桌面。假设您使用的是 systemd:systemd-login使用 /etc/systemd/logind.conf进行设置。

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288
Run Code Online (Sandbox Code Playgroud)

所以我期待这个:

InhibitDelayMaxSec=

Specifies the maximum time a system shutdown or 
sleep request is delayed due to an inhibitor lock of type "delay" 
being active before the inhibitor is ignored and the operation 
executes anyway. Defaults to 5.
Run Code Online (Sandbox Code Playgroud)


N0r*_*ert 4

我向启动板报告了有关您的问题的错误 1782425 。

它会影响gnome-shell,超时是在某处硬编码的。在代码中没有找到正确的位置,但 GUI 是在以下位置定义的gnome-shell-3.28.2/js/ui/endSessionDialog.js

cd ~/Downloads
apt-get source gnome-shell
cd gnome-shell-3.28.2

$ grep -ir "The system will power off automatically in .* seconds" -A3
js/ui/endSessionDialog.js:                        "The system will power off automatically in %d seconds.",
js/ui/endSessionDialog.js-                        seconds).format(seconds);
js/ui/endSessionDialog.js-    },
js/ui/endSessionDialog.js-    checkBoxText: C_("checkbox", "Install pending software updates"),
--
Run Code Online (Sandbox Code Playgroud)

小话。
很棒的是,带有 MATE DE 的 Ubuntu 16.04 LTS、18.04 LTS、19.04 和 19.10 允许用户使用 0 到 300 的值自定义此超时,例如 20 秒

gsettings set org.mate.session logout-timeout 20
Run Code Online (Sandbox Code Playgroud)

MATE 中的注销超时

(或来自dconf-editor)。

  • 不幸的是,在将问题移至 Gitlab 后(https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/369),他们将其关闭。 (2认同)