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,893
  • 7
  • 29
  • 39
  • 1
    There is no easy way according to [this](https://unix.stackexchange.com/questions/242129/gnome-3-how-to-set-power-button-to-shutdown-instead-of-suspend) – mikewhatever Jan 27 '18 at 13:14
  • @mikewhatever there is now a `set-chassis vm` workaround in the same place. – MarcH Jun 20 '20 at 18:24
  • I've opened a PR that will make `set-chassis embedded` works like `vm`, but preserves the airplane mode functionality: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/156 – Rael Gugelmin Cunha Jul 18 '21 at 23:32

4 Answers4

6

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
pasha.zhukov
  • 363
  • 1
  • 3
  • 8
  • 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,525
  • 9
  • 9
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
  • 2