6

How to disable the shutdown confirmation dialogues on Ubuntu 20.04?

4 Answers4

7

You can disable the shutdown and logout dialogs by running:

gsettings set org.gnome.SessionManager logout-prompt false

Note that with this setting your computer will be immediately shut down when you press Power Off..., so you won't be able to use Power Off... to reboot. You can, however, run reboot in a terminal to reboot your computer.

To revert the setting run:

gsettings set org.gnome.SessionManager logout-prompt true
  • Thanks! That did it. – user753441 Sep 11 '20 at 07:52
  • 1
    This works on 18.04 as well. – Andrej Repiský Jan 31 '21 at 07:49
  • 1
    On latest Ubuntu disabling the logout prompt does not disable the 60 second inhibitor, leading to very annoying arbitrary delays before shutting down. Still looking for a less hacky solution to this UX issue. – Dominic Cerisano Apr 14 '22 at 16:27
  • @DominicCerisano have you found a workaround? 22.04 really insists on making us click 4 times to shut down the computer. Even the setting disabling it doesn't work... – user1768761 Jun 04 '23 at 18:44
  • 1
    @user1768761 I use dash-to-panel with a "shutdown" button extension tacked on the end. One click gets the countdown dialog, second click to "power off" immediately. I also installed dracut which prevents shutdown hangs. So two clicks for solid shutdown. Marginal victory for me. – Dominic Cerisano Jun 07 '23 at 22:26
  • @DominicCerisano I installed the bring-out-submenu-of-power-off-logout extension, that's three clicks. – user1768761 Jun 09 '23 at 04:53
  • In 22.04.3 LTS, the result of this tweak is as follows: clicking on the power button yields a Power Off / Log Out option. Clicking on that yields choices: Suspend, Restart, Power Off, Log Out. Choosing the Power Off option shuts the machine down without the final confirmation dialog. – Ray Woodcock Aug 17 '23 at 04:26
3

For the last full updated version of Ubuntu 22.04.1, the way to disable logout prompt (or shutdown confirmation window) is:

  • install dconf editor

    sudo apt install dconf-editor

  • Navigate to:

    org.gnome.gnome-session > logout-prompt > disable

Hope this helps someone.

Rafa J
  • 39
  • Have you tried this out? Does this consistently work for you? For me, the prompt isn't shown, but there is still a ~20 seconds delay before the computer shuts down. – user1768761 Jun 04 '23 at 18:51
  • Yes, it's tested and working on 4 identical computers installed on different buses. – Rafa J Jun 07 '23 at 07:14
  • Interesting, then it works only for some installs. (I have 22.04.2 BTW) @Dominic Cerisano reported the same problem in a comment. – user1768761 Jun 07 '23 at 18:50
  • Maybe it's a hardware issue. In the computers I mentioned we had a tool for configure shutdown time with battery and with power shortage. Have you checked your BIOS? It's possible that offers a similar config for shutdown time. – Rafa J Jun 08 '23 at 13:54
  • @user1768761 I have the issue you describe on one computer, but not on another. No idea why. Both are Ubuntu 22.04. The weird thing is, if I re-enable the prompt, there is no delay. – Jorn Jun 13 '23 at 15:13
  • I think installing dracut AND disabling the prompt might be the way to avoid delays on shutdown. dracut seems to prevent services from invoking annoying timed shutdown inhibitors which I think is what the prompt delay UX is intended to cover (instead of just leaving you wondering about these shutdown delays). dracut is a fairly recent enhanced boot manager, not enabled by default on many distros but probably will be. – Dominic Cerisano Jun 26 '23 at 23:48
0

The shutdown dialog confirmation is provided by the tool gnome-session-quit. The tool does not allow to disable the confirmation for shutdown or restart operations. So there is no easy way to disable the confirmation dialog when you shut down via the user menu, or the "Power off" launcher in the dash.

The terminal commands poweroff or shutdown are configured in Ubuntu 20.04 to be available by normal users. Thus, you could bind one of these commands to a shortcut key, or create a launcher to that command to obtain a quicker way for shutting down the system.

Once you do that, you will realize that you should make sure that shutting down the system is not too easily triggered as to avoid unintended shutdowns.

vanadium
  • 88,010
0

Alongside with installing bring submenu to normal menu extension - allowed to reduce 4 clicks to 2 clicks to poweroff machine - feels like sane amount of actions, much like in win/osx shells

also it making poweroff a last item, to avoid misclicks and being logged out all the time. sadly to admin, its an example of UI, made with perfectly bad UX sense in mind..

xakepp35
  • 307