Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Lubuntu 13.04 and would like to have the power button cause the computer to shut down. Currently it only brings up the power preferences menu (logout, reboot, hibernate, etc...).

In Lubuntu, there is xfce4-power-manager v1.2 and I've tried to fix it here by setting the general->when power button is pressed->shut down option, but this doesn't change anything.

Any help would be much appreciated.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Try this. Edit /etc/acpi/powerbtn.sh, and the make sure that the lines below are the last lines in it.

# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"

also look in /etc/acpi/events/powerbtn, and make sure it matches below, specially the last part.

# /etc/acpi/events/powerbtn
# This is called when the user presses the power button and calls
# /etc/acpi/powerbtn.sh for further processing.

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

# We need to react on "button power.*" and "button/power.*" because
# of kernel changes.

event=button[ /]power
action=/etc/acpi/powerbtn.sh

If you make any changes, make sure you run, before you try to see if it works. You may need to reboot.

sudo service acpid restart
share|improve this answer
    
I'm afraid there is no acpid service (and the directory /etc/acpi doesn't exist) –  cloying Jul 23 '13 at 6:29
    
@cloying You can install acpid with sudo apt-get install acpid –  Glutanimate Aug 18 '13 at 21:16
    
Apologies for the delay but just wanted to say this worked for me after installing acpid. Have marked the question as answered. –  cloying Feb 27 at 17:42
    
Thanks. I'm glad it worked for you. –  Mitch Feb 27 at 19:28
add comment

This is all I needed.

xev | grep "keycode"

https://help.ubuntu.com/community/Lubuntu/Boot_Install_Login#I_want_to_bind_the_power-button_to_change_computer_state.2C_how_do_I_do_it.3F

share|improve this answer
    
Welcome to Ask Ubuntu! How exactly does this make the power button turn off the computer? Please list all the steps you have followed to make the power button directly turn off the computer. –  Alaa Sep 12 '13 at 16:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.