Ubuntu – How to modify the options for the power button


When I press the power button a dialog opens, but I want to shutdown the system without receiving "Do you really really want to shutdown?". How can I choose a direct shutdown action on a pressed power button?

I had the same problem with the 11.04 version, but I don't remember the solution and yesterday I upgraded to Ubuntu 11.10.

Best Answer

  • Lid Close Action

    To set up the Laptop Lid Close Action you have to install Advanced Setting (or the Gnome Tweak Tool). It is in the USC (Ubuntu Software Center) under either tweak or Advanced Settings. If installed press the super button and type in tweak or advanced and choose the Advanced Settings. When it opens choose the shell tab;

    Advanced Settings Before

    Press the arrows and choose you desired on both on AC and on battery;

    Advanced Setting After

    Default buttons behavior

    Install dconf-tools:

    sudo apt-get install dconf-tools

    Press alt+f2 and open dconf-editor (or in a terminal type dconf-editor)

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

    enter image description here

    On some systems you will also need to mark the item suppress-logout-restart-shutdown.