Repository navigation
Add Keychron RGB handler to the theme keyboard pipeline - #9545
reeseroyster wants to merge 5 commits into
Conversation
|
There is a migration-ID collision with #9478: both PRs add Could one migration receive an unused timestamp before the PRs land? This avoids the add/add merge conflict and prevents either operation being lost when resolving it. The same filename is also used by #9522 for nwg-displays workspace loading and #9562 for the XDG Desktop directory. Those four unrelated migrations need separate IDs. |
1788129995.sh collides with six other open PRs (omacom#9276, omacom#9445, omacom#9446, omacom#9478, omacom#9522, omacom#9562); same filename means the same completion marker, so only the first merged migration would ever run. Renamed to the fresh, currently-unused timestamp 1789739221.
|
Good catch — fixed in 0f80aad: the migration is now For what it's worth the collision was wider than the four PRs listed here: |
|
Confirming the rule fixes the Keychron Launcher (launcher.keychron.com) on its own, as the rule's comment says: Keychron K15 Max over USB, Omarchy 4.0.4-1, Brave and Chrome. Without it the Launcher sits at "connecting" forever with nothing in the browser console — the keyboard's hidraw nodes are root-only, so WebHID can't open them: Granting the user access to those nodes ( One thought: the rule is only installed when a Keychron is connected at install or migration time ( |
|
@josemiguelo Thanks for confirming the Launcher behavior. Fixed in 08a135b: the udev rule is now installed unconditionally during hardware setup, and a migration covers existing installs. Both reload udev and retrigger hidraw so already-connected Keychrons pick up the access rule too. |
|
|
Thanks for the review. Fixed in 790600f: the theme dispatcher now calls the correct handler; set/get preserve HSV brightness and failed saves return an error; the handler skips machines without Keychron hardware; and udev grants access only to hidraw interfaces with the config-channel report descriptor. The install/migration path installs the checker and replaces the exact shipped broad rule while preserving customized rules. Added focused coverage. Verified with |
Summary
Adds Keychron RGB support to the existing
keyboard.rgbtheme pipeline, following theomarchy-theme-set-keyboard-asus-rog/-f16handler pattern exactly.Keychron's own firmware (V/Q/K "Ultra" and "Max" series, protocol v11+) implements the VIA raw-HID protocol on a vendor config channel (USB usage page
0xFF60, usage0x61). It is the same lighting command set the Framework 16 handler already speaks viaqmk_hid: solid effect ([7,3,2,1]), HSV color ([7,3,4,h,s]), NVRAM save ([9,3]). The protocol was extracted from Keychron's own Launcher web app (WebHID client) — no firmware flashing, no reverse-engineered vendor blobs.Changes
bin/omarchy-keychron-rgb— transport: bash + embedded Python (stdlib only, no new packages, nothing to compile). Auto-discovers the config channel by vendor3434+ usage-page signature and round-trip-probes it, so it works across models and connection modes (with cable and dongle both enumerated, one channel is a dead end depending on the keyboard's mode switch — the probe picks the live one).bin/omarchy-hw-keychron— hardware detect (USB vendor3434),hw-*pattern.bin/omarchy-theme-set-keyboard-keychron— the handler; no-op without a Keychron present.bin/omarchy-theme-set-keyboard— dispatch entry.default/udev/keychron-rgb.rules+install/hardware/keychron-rgb.sh+ migration — vendor-wide uaccess rule (also unblocks the official Keychron Launcher web app), mirroringframework/qmk-hid.sh.install/hardware/all.sh— install wiring.Verified behavior
Tested on a Keychron V1 Ultra 8K (ZMK-based,
3434:0c10) plus Ultra-Link 8K 2.4GHz dongle (3434:d028):keyboard.rgb(ff00ff) overriding the accent template.keyboard.rgb).Testing
./test/cli— 116 ok, 0 failures (includes metadata lint for the new commands)../test/shell— 2905 ok, 0 failures.Transparency
This contribution was developed end-to-end with AI assistance (an agentic CLI coding assistant): protocol extraction from the Launcher bundle, tool implementation, and the automated 22-theme verification. The submitter performed all hardware verification on their machine.
One natural follow-up (not in this PR to keep it scoped): a udev
RUN+on the rule could invoke the handler on (re)plug, re-syncing the keyboard at boot and whenever it returns from wireless to wired. Happy to add if wanted.