I disabled the power button on my desktop (pressing it did nothing, no shutdown, no hibernation/sleep, because my kids like it to press)
After I upgraded my ubuntu from 18LTS to 20LTS, the disabled power button behaviour does not work anymore. When it is pressed, it hibernates the PC.

Here are my current settings gsettings list-recursively org.gnome.settings-daemon.plugins.power

org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
org.gnome.settings-daemon.plugins.power time-critical 300
org.gnome.settings-daemon.plugins.power power-button-action 'nothing'
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false
org.gnome.settings-daemon.plugins.power button-hibernate 'nothing'
org.gnome.settings-daemon.plugins.power idle-dim true
org.gnome.settings-daemon.plugins.power button-power 'nothing'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power priority 0
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power active true
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power button-suspend 'nothing'
org.gnome.settings-daemon.plugins.power button-sleep 'nothing'
org.gnome.settings-daemon.plugins.power percentage-critical 3
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 3600
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
org.gnome.settings-daemon.plugins.power ambient-enabled true
org.gnome.settings-daemon.plugins.power notify-perhaps-recall true
org.gnome.settings-daemon.plugins.power percentage-low 10
org.gnome.settings-daemon.plugins.power percentage-action 2
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power time-low 1200
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 1200
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power use-time-for-policy true

cat /etc/systemd/logind.conf


Have you any ideas what could be wrong?
Thank you for your help.

  • 1
    are you for sure looking in the correct environment for which you are using? ie) com.canonical.unity.settings-daemon.plugins.power button-suspend OR org.mate.power-manager button-suspend ???? Are there any other desktops installed, if so, does the button work as expected there?
    – WU-TANG
    Commented Oct 3, 2020 at 0:09
  • 1
    This might help: unix.stackexchange.com/questions/547582/… Another option is to raise your voice when your kids do something wrong. Commented Oct 4, 2020 at 0:39
  • is this helpfull? askubuntu.com/questions/1070915/…
    – nobody
    Commented Oct 5, 2020 at 10:19
  • Did you have a chance of testing the solutions posted? Commented Oct 5, 2020 at 10:47
  • disconnect the power button from the motherboard and configure the BIOS to power on automatically when power is restored. It would require cycling the surge protector to turn in on after shutting down.
    – rtaft
    Commented Oct 5, 2020 at 16:00

4 Answers 4


I am not sure what is wrong with your files.

  1. The logind-way

    Did you try

    sudo systemctl restart systemd-logind

    or (better) rebooting?

  2. The acpid-way

    Besides, this a possible method to obtain the behaviour you are looking for. Create an ACPI handler with a file in /etc/acpi/events/

    sudo nano /etc/acpi/events/powerbtn-acpi-support

    (Note: as per official info, "Rules are defined by simple configuration files. acpid will look in a configuration directory (/etc/acpi/events by default), and parse all regular files that do not begin with a period ('.') or end with a tilde (~).")

    Make that file contain

    event=button[ /]power

    Then restart the acpi daemon with

    sudo service acpid restart


  1. The cardboard-way is funny.




How to prevent the Power button to shutdown directly the system?


  • I saw the /etc/acpi/events/powerbtn-acpi-support reference from 2014 in a google search. That was renamed to: /etc/acpi/events/powerbtn in my Ubuntu 16.04. Did you check if it exists on your system? Commented Oct 4, 2020 at 0:41
  • @WinEunuuchs2Unix - Confirmed. The name of the handler can be almost anything, see updated answer for the detail. Commented Oct 4, 2020 at 22:17
  • What happens if system is crashed or partially crashed? Can I use long power press to shutdown computer? Is it the behaviour for short power press, right?
    – laimison
    Commented Oct 19, 2022 at 0:04

Ubuntu 20.04 LTS has it in the GUI controls. There is an option to make the power button "Do nothing" in the Power Button Behavior dropdown menu.
enter image description here

  • The only answer that worked for me, and it's the easiest one so far. Thanks.
    – Sumit
    Commented Nov 28, 2020 at 9:53

Check to see if there are other desktop environments in play like:

You may have made 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 yields:
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'


For some reason, the sleep.conf is rarely if ever mentioned, I couldn't get anything else to work from the proposed solutions on Ubuntu Jammy (22.04LTS) so finally this one solved it:

$ sudo nano /etc/systemd/sleep.conf

Then, change the following lines like this to disable all power options:


After that, sudo ldconfig and/or a restart and you should be all set.

You must log in to answer this question.

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