更改关机确认计时器

我想更改“系统将在60秒内自动关机”对话框中的计时器。 我的设备上的电池在此消息中死了大约30秒。

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

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

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

看到

/etc/acpi/powerbtn.sh 

重要部分:

 # 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" 

您可能有更多选项(我检查过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 

所以我希望这个:

 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. 

我向启动板报告了有关您的问题的错误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"), -- 

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

 gsettings set org.mate.session logout-timeout 20 

MATE中的logout-timeout

(或来自dconf-editor )。

您可以从终端关闭。 试试这个30秒

 sudo shutdown -h -t +30