How to disable the shutdown confirmation dialogues on Ubuntu 20.04?
4 Answers
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

- 14,585
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.

- 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
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.

- 88,010
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..

- 307
dracut
which prevents shutdown hangs. So two clicks for solid shutdown. Marginal victory for me. – Dominic Cerisano Jun 07 '23 at 22:26