Change shutdown confirmation timer

5,617

Solution 1

I reported bug 1782425 about your problem to the launchpad.

It affects gnome-shell, the timeout is hard-coded somewhere. Did not find right place in code, but the GUI is defined in 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"),
--

Small remark.
It is great that Ubuntu 16.04 LTS, 18.04 LTS, 19.04 and 19.10 with MATE DE allows user to customize this timeout with values from 0 to 300, for example 20 seconds with

gsettings set org.mate.session logout-timeout 20

logout-timeout in MATE

(or from dconf-editor).

Solution 2

Remark: hitting the shutdown option TWICE will ignore the timer and shutdown regarding the timer. That might be another option for you.

See

/etc/acpi/powerbtn.sh

Important part:

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

Your might have more options (I checked 16.04.4 server ) It has several options in the to test for different desktops. Assuming you are using systemd: systemd-login uses /etc/systemd/logind.conf for its settings.

[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

So I would expect this one:

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.
Share:
5,617

Related videos on Youtube

cawwot
Author by

cawwot

"You can easily judge the character of a man by how he treats those who can do nothing for him." -Johann Wolfgang von Goethe

Updated on September 18, 2022

Comments

  • cawwot
    cawwot over 1 year

    I would like to change the timer on the "The system will power off automatically in 60 seconds" dialog. The battery on my device dies about 30 seconds into this message.

    There doesn't seem to be a setting for this in the usual places (gsettings, dconf, system settings, etc).

    I am not interested in removing this dialog or changing the shutdown behavior, I just want to change the amount of time that it waits.

    • Rinzwind
      Rinzwind almost 6 years
      Another thing: you could also up the percentage when the notice shows up. So not at (for instance) 10% but at 11%, assuming 1% decrease takes more than 30 seconds you need ;)
  • N0rbert
    N0rbert almost 6 years
    Great answer, but what if user wants to click on "virtual" power button in the GNOME interface. User can't make such click twice.
  • Rael Gugelmin Cunha
    Rael Gugelmin Cunha over 4 years
    Unfortunately, after move the issue to Gitlab, they closed it.
  • Stefan Reich
    Stefan Reich almost 3 years
    Just a note: On a "vanilla" Ubuntu 20 (can't remember changing anything), this does nothing