12

I want the PC to shut down without any dialogue, but let time for the applications to close properly.

One solution is, to change powerbtn.sh to: shutdown -h now but that does not wait for all applications to close.

0

2 Answers 2

11

gsettings set org.gnome.settings-daemon.plugins.power button-power shutdown

will change your the behaviour of the power button of your system from interactive (default) to immediate normal shutdown.

The command is gsettings set org.gnome.settings-daemon.plugins.power button-power <option>

Available options are:

  • Blank: does nothing
  • Suspend: makes your system suspend
  • Shutdown: starts a normal issued shutdown procedure
  • Hibernate: hibernates your system
  • Nothing: does nothing
  • Log out: log your user out
4
  • 3
    Thanks for this answer. Where is this documented? Apr 14, 2015 at 0:27
  • I don't know where this is documented. Possibly it is not. You can see the set of valid values with the gsettings range command. In this case, gsettings range org.gnome.settings-daemon.plugins.power button-power. Right now, in Fedora 22, the valid values are 'blank', 'suspend', 'shutdown', 'hibernate', 'interactive', 'nothing', and 'logout'. This list includes "interactive" which isn't in Bruno's list, and they are all lower case, with no spaces in "logout". I'm confident this list is syntactically correct, and Bruno's is not. No offense to Bruno.
    – matty
    Jun 12, 2015 at 2:45
  • I just add the point that you should not run this command as a root.
    – ar2015
    Jul 27, 2017 at 6:58
  • This key was renamed from button-power to power-button-action at some point.
    – Jivan Pal
    Apr 21, 2023 at 0:30
11

To do it GUI:

Install dconf-tools:

sudo apt-get install dconf-tools

open dconf-editor from dash or just run dconf-editor & in terminal

Navigate to org.gnome.settings-daemon.plugins.power and set your default button-power action there:

enter image description here

replace suspend by shutdown.

1
  • Confirmed that this worked for a fully updated Ubuntu 14.04 LTS. Feb 15, 2016 at 2:55

Not the answer you're looking for? Browse other questions tagged .