4

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.

1
  • 1
    It looks like you don't mind doing your own research so what about trying to remap the power button key to something harmless? That is only till you find the real solution, of course. This is only a suggestion. I haven't tried remapping anything myself.
    – user25656
    Oct 27, 2013 at 1:59

2 Answers 2

6

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.

4
  • Eh - Cazzo! Grazie Bello Gnocco!! You're right, I am very new to Ubuntu and although I've come across commenting already, the guide I read must have omitted mentioning it and I didn't click. Major face-palms for wasting so long when I could have solved it so long ago but elation for having the issue resolved. Thank you.
    – Gully.Moy
    Dec 13, 2013 at 0:17
  • For others' reference - I omitted the second line and the fix worked great without it. As Stéphane said - it's probably overkill.
    – Gully.Moy
    Dec 13, 2013 at 0:23
  • When upgrading to Ubuntu 14.04 things just worked out of the box so I did not have to repeat this fix. Sep 15, 2014 at 7:55
  • +1. Adding here for anyone interested that this is what I had to do to allow the shutdown key to be remapped in fluxbox. Apr 7, 2020 at 9:32
2

I am afraid you are just cought in a known bug, as all of us are :( https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1222021

Let's hope they'll fix it soon, you can probably make it more "hot" by clicking on "affects me too!"

1
  • That bug seems to be about the laptop going into sleep when the lid is closed. My problem is that the laptop shuts down the moment I touch the power button without asking me what I want to do, despite numerous attempts to program it otherwise. Or are you saying you think you think it comes under the same bug?
    – Gully.Moy
    Dec 12, 2013 at 23:51

You must log in to answer this question.

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