Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Chromebook: control reactions to power button

I discovered a better way to control what my Acer Chromebook C720-ZHN does in reaction to my pressing the power button. I want it to pull up my logout manager, but init/acpi/something (apparently "elogind," frickin' systemd people) really wants to react to it. I previously wrote a very complicated elogind-inhibit script available on one of my previous posts about this topic.

But here is a simpler way which I discovered after I reinstalled and before I got my custom package installed again.

# file: /etc/elogind/logind.conf.d/40-stackrpms.conf
# Startdate: 2025-03-02-1 15:56
# Reference:
#    unix.se 288731
#    /etc/elogind/logind.conf
[Login]
HandlePowerKey=ignore
HandleRebootKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore

And then xev and other developer tools and window managers can react to that keystroke and run the logout manager.

# inside file: /etc/stackrpms-acer-chromebook/fluxbox.keys
124 :Exec logout-manager-gtk

References

  1. arch linux - Disable the Power button on a Chromebook - Unix & Linux Stack Exchange

Comments