Last active
October 19, 2025 10:01
-
-
Save numpde/3a9b665779b570e612cf92d751af366b to your computer and use it in GitHub Desktop.
The script detects the ROG Falchion System Control device and creates a udev rule to disable it as a system input device, preventing unwanted suspend actions, then reloads udev rules and optionally reboots to apply the change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Disable the ROG Falchion *System Control* interface in libinput (Wayland-safe) | |
| # Ref: https://wayland.freedesktop.org/libinput/doc/latest/ignoring-devices.html | |
| set -euo pipefail | |
| (( EUID == 0 )) || { echo "Run as root (sudo)"; exit 1; } | |
| # Defaults for the Falchion 2.4G dongle; override via env if needed. | |
| VID="${VID:-0B05}" | |
| PID="${PID:-193E}" | |
| IFACE="${IFACE:-02}" # bInterfaceNumber for System Control | |
| rule=/etc/udev/rules.d/99-ignore-rog-falchion-system-control.rules | |
| cat >"$rule" <<EOF | |
| # Ignore ASUS ROG Falchion System Control (prevents KEY_POWER/SLEEP/WAKEUP reaching the compositor) | |
| # USB HID event nodes only; target vendor/product and interface 02 | |
| ACTION!="remove", KERNEL=="event[0-9]*", SUBSYSTEM=="input", \ | |
| ENV{ID_VENDOR_ID}=="${VID}", ENV{ID_MODEL_ID}=="${PID}", \ | |
| ATTRS{bInterfaceNumber}=="${IFACE}", \ | |
| ENV{LIBINPUT_IGNORE_DEVICE}="1" | |
| EOF | |
| echo "Wrote $rule" | |
| # Reload rules and re-evaluate only matching devices | |
| udevadm control --reload | |
| udevadm trigger --subsystem-match=input --action=change | |
| # Try to find the current event node(s) for System Control | |
| echo "Probing matching devices:" | |
| for dev in /dev/input/event*; do | |
| [[ -e "$dev" ]] || continue | |
| if udevadm info -q property -n "$dev" | grep -Eq \ | |
| "ID_VENDOR_ID=$VID|ID_VENDOR_ID=${VID,,}"; then | |
| props="$(udevadm info -q property -n "$dev")" | |
| if grep -qE "^ID_MODEL_ID=(${PID}|${PID,,})" <<<"$props" \ | |
| && grep -q "^ID_BUS=usb" <<<"$props" \ | |
| && udevadm info -a -n "$dev" | grep -q "bInterfaceNumber\)==\"${IFACE}\""; then | |
| echo " - $dev" | |
| echo "$props" | grep -E 'LIBINPUT_IGNORE_DEVICE|ID_INPUT|ID_MODEL|ID_VENDOR' || true | |
| fi | |
| fi | |
| done | |
| echo | |
| echo "If LIBINPUT_IGNORE_DEVICE isn't shown for the System Control node yet:" | |
| echo " - Unplug/replug the dongle or power-cycle the keyboard." | |
| echo " - Then run: libinput list-devices | grep -A2 -i 'falchion'" | |
| echo "To revert: rm $rule && udevadm control --reload && udevadm trigger -s input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment