3

This is my first question here, so if I goof on a convention kindly let me know.

Configuration:

Ubuntu 14.04.2 with Xfce 4.10 using crouton on an Acer c720 Chromebook

Issue:

The default behavior of the power button (located directly above the backspace key) is to abruptly power off linux with no delay, warning, or confirmation.

Steps Taken:

  1. I have already uncommented the appropriate lines in /etc/systemd/logind.conf to no effect. See the file's excerpted contents below.

  2. I have also changed the appropriate lines in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml, also to no effect. See the file's contents below.

  3. I attempted to locate the powerbtn.sh script discussed in other threads. This file is known to live in /etc/acpi/something-else... but I have no /etc/acpi directory. I attempted to find this script, but that yielded no results.

Referenced Files:

cat /etc/systemd/logind.conf

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
Controllers=blkio cpu cpuacct cpuset devices freezer hugetlb memory perf_event net_cls net_prio
ResetControllers=
#InhibitDelayMaxSec=5
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min

cat .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="uint" value="3"/>
    <property name="hibernate-button-action" type="uint" value="3"/>
    <property name="sleep-button-action" type="uint" value="3"/>
    <property name="critical-power-action" type="uint" value="3"/>
  </property>
</channel>

Any help would be greatly appreciated as this is quite the nuisance.

1

Alright, so I stumbled upon the answer to my own question quite by accident.

I probably should've mentioned this before, but I also tried to find out what keycode and keysym the power key was attached to through xev, but it registered nothing when the key was pressed.

Anyhow, I just recently changed over from using the Xmonad window manager to the i3 window manager (great switch btw, i3 is awesome!). As I was configuring i3, it crossed my mind to check and see if the power key would behave the same way as it had under Xfce/Xmonad. I pressed it and, nothing!

After letting out an emotionally charged cry of victory over this nuisance, I immediately started xev and discovered that (at least on this model chromebook) the power key is registered to keycode 124. I then altered my ~/.Xmodmap file to include the line:

keycode 124 = F11 F11 F11 F11

Finally, I restarted Ubuntu and lo and behold, xev now appropriately registers the "F11" key being pressed and the system doesn't abruptly shut down.

I hope that this is helpful to anyone who was suffering the same frustrations. Peace be with you!

1

In /usr/share/X11/xkb/symbols/inet, look for <POWR> and apply your action of choice.

  • Coming back to this issue with a fresh install of Ubuntu 17 on the same chromebook required this change in addition to editing /etc/systemd/login.conf – CNakai Sep 14 '17 at 21:41
0

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 run

xinput disable devnumber something like xinput disable 8

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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