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?

Witek
  • 3,933

4 Answers4

7

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. – user1768761 May 23 '23 at 23:39
  • for Ubuntu Mate 22.04 the relevant keys are ``` gsettings set org.ayatana.indicator.session suppress-logout-restart-shutdown true gsettings set org.mate.session logout-prompt false gsettings set org.mate.session logout-timeout 10
    
    
    – geekQ May 31 '23 at 17:06
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.

Andrew
  • 1,535
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.

0

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

1u-
  • 109