I did a fresh install of Ubuntu 13.10. When I press my power button, my computer immediately shuts down. In Ubuntu 13.04 I got a nice menu, where I could choose what to do. It is gone now and I want it back. Here is my /etc/acpi/powerbtn.sh
in pastebin.
I already did
gsettings set org.gnome.settings-daemon.plugins.power button-WORD 'interactive'
where WORD
is hibernate
, power
, sleep
and suspend
.
Check your
/etc/systemd/logind.conf
file. It should look like this:Uncomment the line that says
#HandlePowerKey=poweroff
and change the value toignore
.Then restart the logind with the command:
sudo systemctl restart systemd-logind
or reboot your computer.EDIT: how to create a new acpi handler Create a new file in
/etc/acpi/events/
. The content of the file should be:where
<acpi_event_code>
is the code you get using theacpi_listen
tool and<script_to_call>
is the full path to the script you wish to call when that event happens.They must have changed something in 13.10 because it seems that I have too few files in my /etc/accpi/events folder compared to the 13.04.
jeremijah put me on the right track so kudos!
I edited
/etc/systemd/logind.conf
as recommended, but I also did this.If the above solutions don't work for you, Here is a quick work around:
This utility does the work for you. Though this may not answer the question, in the many solutions I'v tried (including the ones on this page) none seem to work
To install:
To use: Type
xtrlock
in the command line. This will freeze mouse, keyboardTo unlock type your password and press [Enter]
It can also freeze your power button.
P.S This solution is particularly useful for those who have kids and want the power button disabled for that reason.
First you could edit your keymap file to change the behavior of the power button to assign it to an other key
Edit the file :
/usr/share/X11/xkb/symbols/inet
(edit POWR key)Then you will need to disable the power button efficiently a good method is with xinput
run
xinput --list
power buttons have their own entry... pick the device number then runxinput disable devnumber
something likexinput disable 8