7

I would like my Computer to just power off when I press the hardware Power Button. Instead I dialog with a countdown and Options (Cancel, Restart, Power Off) comes up. How to disable this dialog and power off immediately?

Or at least, how to set the countdown to much, much less then 60 seconds?

3

4 Answers 4

5

Ubuntu 18.04

gsettings set org.gnome.SessionManager logout-prompt false

or you can also try

gsettings set com.canonical.indicator.session suppress-logout-restart-shutdown true
1
  • On 22.04 the first one removes the dialog but not the delay, so the computer doesn't shut down immediately... The second schema doesn't exist on this system. May 23 at 23:39
1

In Ubuntu 20.10 I found it under org.gnome.settings-daemon.plugins.power. The default value is interactive, but you can change it to shutdown.

Change it using gsettings like pasha's answer, or use dconf-editor, which has a GUI.

0

Using

org.gnome.gnome-session logout-prompt 'false'

and

org.gnome.settings-daemon.plugins.power button-power 'shutdown'

worked for me on Ubuntu 20.04 LTS. A nice side effect is, that this also causes immediately Power-Off by HDMI-CEC controls.

1
  • On 22.04 it removes the dialog but not the delay, so the computer doesn't shut down immediately... May 23 at 23:37
-1

Check if there are other desktop environments like: com.canonical.unity.settings-daemon.plugins.power or org.mate.power-manager

There might be the correct change, but for the wrong environment...

a more generic search of your gsettings can also help: gsettings list-recursively | grep button on my system additionally shows:

.
.
.
com.canonical.unity.settings-daemon.plugins.power power-button-action 'suspend'
com.canonical.unity.settings-daemon.plugins.power button-hibernate 'hibernate'
com.canonical.unity.settings-daemon.plugins.power button-power 'suspend'
com.canonical.unity.settings-daemon.plugins.power button-suspend 'suspend'
com.canonical.unity.settings-daemon.plugins.power button-sleep 'hibernate'

As answered here by WU-TANG

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.