diff options
| author | 2026-05-13 13:43:33 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:33 +0100 | |
| commit | 120ee3a0712594fb0c4fdf99c04f0e9d8874335d (patch) | |
| tree | 8d1085b0e3512e8cb851cfdfcab362d7922c08f9 /etc/systemd | |
| parent | 66427c37fcc05ffbecde726aeea77ccfb1b860de (diff) | |
| download | dotfiles-120ee3a0712594fb0c4fdf99c04f0e9d8874335d.tar.gz dotfiles-120ee3a0712594fb0c4fdf99c04f0e9d8874335d.tar.bz2 dotfiles-120ee3a0712594fb0c4fdf99c04f0e9d8874335d.zip | |
fix(logind): ignore KEY_POWER short-press to stop Shokz dongle shutdowns
The Shokz OpenMeet dongle (3511:2EF2) emits KEY_POWER on USB
enumeration and on headset power transitions, which logind handles
with HandlePowerKey=poweroff and immediately shuts the host down.
The previous attempt — an hwdb scancode remap of c0030 to reserved —
sets the udev property correctly but the kernel does not honor
EVIOCSKEYCODE for this device's HID consumer-page mapping (verified:
KEY_POWER 116 still appears in the evdev keymap after udevadm trigger
and libinput still reports it). Drop the hwdb file and the
systemd-hwdb hooks from the etc deploy script.
Replace with a logind drop-in that sets HandlePowerKey=ignore and
HandlePowerKeyLongPress=poweroff. Single-tap power events from any
source become no-ops; a 5s hold still shuts the machine down, so the
real hardware-power-button safety net is preserved. Add a HUP to
systemd-logind in the deploy script so the change takes effect
without restarting the daemon.
Diffstat (limited to 'etc/systemd')
| -rw-r--r-- | etc/systemd/logind.conf.d/10-ignore-power-key.conf | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/etc/systemd/logind.conf.d/10-ignore-power-key.conf b/etc/systemd/logind.conf.d/10-ignore-power-key.conf new file mode 100644 index 0000000..b5d5e34 --- /dev/null +++ b/etc/systemd/logind.conf.d/10-ignore-power-key.conf @@ -0,0 +1,11 @@ +[Login] +# Ignore single-tap KEY_POWER from any source. The Shokz OpenMeet dongle +# (3511:2EF2) emits KEY_POWER on USB enumeration and on headset power +# transitions, which would otherwise immediately shut the host down. An +# hwdb scancode remap was attempted but the kernel does not honor +# EVIOCSKEYCODE for this device's HID consumer-page mapping. +# +# Long-press (>=5s) still triggers poweroff, preserving the real +# hardware-power-button safety net. +HandlePowerKey=ignore +HandlePowerKeyLongPress=poweroff |
