Open the app with the Predator key, bump to 1.3.0

The Predator key sends keyboard usage 0xC9, which lies outside the
logical range the keyboard declares, so the kernel never emits an input
event for it. It is also reported on vendor report 4 of USB interface 2
(04 81 ff on press). predatord now listens there and opens the app in
the active graphical session via the user's systemd manager.

The action is configurable on the System page: open the app, switch to
the next performance mode, or do nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 17:51:21 +02:00
co-authored by Claude Opus 5.5
parent cc4fdb9cd0
commit 5b7534560f
11 changed files with 142 additions and 8 deletions
+3 -2
View File
@@ -13,6 +13,7 @@ import threading
ACER_VID = 0x04F2
KNOWN_PIDS = (0x0117, 0x011A)
LED_INTERFACE = 3
HOTKEY_INTERFACE = 2 # vendor report 4 carries the Predator key
NUM_CELLS = 128
OP_BEGIN = 0x88
@@ -57,7 +58,7 @@ def checksum(body7):
return (0xFF - (sum(body7) & 0xFF)) & 0xFF
def find_hidraw():
def find_hidraw(interface=LED_INTERFACE):
"""Path of the hidraw node of the LED interface, or None."""
for node in sorted(glob.glob("/sys/class/hidraw/hidraw*")):
try:
@@ -76,7 +77,7 @@ def find_hidraw():
devpath = os.path.realpath(os.path.join(node, "device"))
# .../1-7:1.3/0003:04F2:011A.0004 -> interface number from the parent
iface = os.path.basename(os.path.dirname(devpath)).rsplit(".", 1)[-1]
if iface == str(LED_INTERFACE):
if iface == str(interface):
return "/dev/" + os.path.basename(node)
return None