aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--etc/systemd/logind.conf.d/10-ignore-power-key.conf11
-rw-r--r--etc/udev/hwdb.d/70-shokz-openmeet.hwdb7
-rwxr-xr-xrun_onchange_after_deploy-etc.sh.tmpl7
3 files changed, 14 insertions, 11 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
diff --git a/etc/udev/hwdb.d/70-shokz-openmeet.hwdb b/etc/udev/hwdb.d/70-shokz-openmeet.hwdb
deleted file mode 100644
index f35b94e..0000000
--- a/etc/udev/hwdb.d/70-shokz-openmeet.hwdb
+++ /dev/null
@@ -1,7 +0,0 @@
-# Shokz OpenMeet (Loop120 dongle, 3511:2EF2) emits HID Consumer-page Power
-# (scancode c0030 -> KEY_POWER) on enumeration AND when the headset is
-# powered off, which causes systemd-logind to shut down the host. Suppress
-# only that scancode; KEY_MUTE / volume / media keys on the same Consumer
-# Control node remain functional.
-evdev:input:b0003v3511p2EF2*
- KEYBOARD_KEY_c0030=reserved
diff --git a/run_onchange_after_deploy-etc.sh.tmpl b/run_onchange_after_deploy-etc.sh.tmpl
index adf00eb..d08f989 100755
--- a/run_onchange_after_deploy-etc.sh.tmpl
+++ b/run_onchange_after_deploy-etc.sh.tmpl
@@ -27,10 +27,9 @@ done
# sudo-rs: /etc/pam.d/sudo-i is a symlink to /etc/pam.d/sudo
sudo ln -sfT sudo /etc/pam.d/sudo-i
-# Recompile the udev hardware database so any etc/udev/hwdb.d/*.hwdb files
-# we just deployed take effect on next device event.
-sudo systemd-hwdb update
-sudo udevadm trigger --subsystem-match=input --action=change
+# Reload systemd-logind so changes under /etc/systemd/logind.conf.d/
+# (e.g. HandlePowerKey overrides) take effect without dropping sessions.
+sudo systemctl kill -s HUP systemd-logind
# Make sudo-rs the system-wide sudo via /usr/local/bin precedence.
# Targets may not exist yet on first bootstrap (sudo-rs is installed by