Ubuntu – Change power button to ‘Ask’ in Xubuntu 13.10

acpipower-managementshutdownxfcexubuntu

I have recently installed Xubuntu 13.10 on my Vaio vpcea making me a Linux beginner. The problem is that laptop's power button is right on the edge of the bezel making it far too easy to press accidentally, in my opinion a design fault by Sony.

At present, when I press the power button it shuts down strait away and as you can imagine, when I'm accidentally pressing it all the time it gets very annoying! So I planned to change it to ask what I would like to do when I press it or at least ask if I'm sure.

So I went through the xfce GUI options "Settings Manager" – "Power Manager" to the field "When power button is pressed", but it was already set to "Ask". So I did some digging and found a thread telling me to navigate to /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml where it said to find power-button-action and check that value="3". It already did.

So I looked some more and found this thread which focuses on acpi scripts. I tried solution 1 & 2 using sudoedit to change the files accordingly (I have made executable bash shell scripts already so I think I followed them correctly), but still no difference.

I also found this thread which instructed me to edit /etc/systemd/logind.conf so that HandlePowerKey=ignore. Still no luck.

I even tried my own approach to completely disable /etc/acpi/powerbtn.sh by renaming it powerbtn.sh.bak hoping for at least no response from the power button… and I have done many reboots in between… but still it shuts down!

I have also read that some people have the file /etc/acpi/events/power_button, but I do not.

So does anyone have any other ideas? What else could be executing the shutdown sequence Is there something I'm missing?

I haven't undone any of these actions so every one of the above files is currently edited on my computer, with the exception that "Solution 2" automatically undone "Solution 1" above.

Thanks guys.

Best Answer

Thanks @crysman, I believe it is indeed the bug you mentioned.

To @Gully.Moy:

Thanks for reporting. You wrote:

I also found this thread which instructed me to edit /etc/systemd/logind.conf so that HandlePowerKey=ignore. Still no luck.

That worked for me. Here's exactly what I did:

  • Most lines in /etc/systemd/logind.conf are commented out with a starting #. I inserted this line:

    HandlePowerKey=ignore
    
  • Then I did as root:

    killall -9 /lib/systemd/systemd-udevd /lib/systemd/systemd-logind
    

which is probably overkill and even a bit rude.

That did the job. Now pressing the power button yields xfce "ask" window.

I did not try any other change you describe.