How to shut down Lubuntu immediately with the power button instead of a logout method dialog prompt

10,263

This is a configurable option in the XFCE Power Manager, which was installed by default in my relatively fresh Lubuntu 14.04.1 installation (a laptop). I found it at Preferences > Power Manager. If it's not installed already for you, you should be able to install it with sudo apt-get install xfce4-power-manager

In "General Options", you'll want to select "When power button is pressed: Shutdown" (default setting is "Ask" - which brings up the popup menu you want to skip). See the starred line in the image below.

Xfce Power Manager General Options screen with power button setting indicated by red stars.

I needed to log out of Lubuntu and log back in for this setting to take effect, but after that, one press of the power button shut down my system.

Hope this works for you!

Share:
10,263

Related videos on Youtube

Rockishi
Author by

Rockishi

Updated on September 18, 2022

Comments

  • Rockishi
    Rockishi over 1 year

    I would like the computer to shut down directly after I press the power button. At the moment, Lubuntu opens a shutdown method dialog box when I press the shutdown button.

    I suspect I can simply modify the Lubuntu-rc.xml file in the .config/openbox/ folder. I used that file to easily change other shortcut keys. If this is the case, I believe I have found the proper line of code where the shutdown command should be. But when I enter the command "sudo shutdown - now" in the appropriate place, it doesn't work. Is there another command I should enter for the physical power button to shutdown the computer immediately?

    `<!-- Launch logout when push on the shutdown button -->
    <keybind key="XF86PowerOff">
      <action name="Execute">
        <command>lxsession-default quit</command>
      </action>
    </keybind>`
    
  • Rockishi
    Rockishi over 9 years
    Thanks. But this is precisely what I am trying to avoid. My question states that I would like the computer to turn off directly after hitting the power button. This allows me to hit the power-off button and walk away as it works. Currently if I have a complete session loaded it takes a bit on my older computer to load the shutdown dialog prompt. I have to wait for it to load, and then press enter. I'm not habituated to it because with Xubuntu my family and I just hit the power button and it's done. Now we hit the power button and the computer stays on until someone catches it a few hours later
  • gyropyge
    gyropyge over 9 years
    Well then, this works perfectly. You see, there is a way to do exactly what you wish, and I'm pretty sure that if one of us goes back far enough in my answers on this site we will see that another user worked out a way to avoid the dialogue screen at which I advised pressing enter. He apparently did this thinking that the drop down menu was annoying enough. As a consequence of my directing him to the power button shortcut, combined with his shutdown dialogue bypass, the end result was that tapping the power button sent the computer into an expedited shutdown.
  • Rockishi
    Rockishi over 9 years
    Hello, I tried your method, but unfortunately my Lubuntu 14.10 doesn't have the folder acpi inside /etc/. And a search for the term 'powerbtn' in /etc/ didn't reveal any results.
  • Rockishi
    Rockishi over 9 years
    Hello, I also have the same Xfce Power Manager on my Lubuntu 14.10. My already have it at shutdown, I tried switching it back to ask, restarting, and switching back to shutdown, and no luck. My settings for 'power button pressed' are also 'shutdown', but it still asks when I press the button. Mystifying.
  • drkokandy
    drkokandy over 9 years
    That's strange - it worked for me on 14.04. I'll take another look.
  • wump
    wump about 4 years
    doesn't seem to work anymore as of ubuntu 18.04, here 😐 no matter what the setting is set to, the dialog appears (yes, xfce4-power-button is running and acpid is installed)