Imported from kcotugno/omarchy-qmk-rgb (
AGENTS.md). Install upstream withnpx skills add kcotugno/omarchy-qmk-rgb. Copyright stays with the author.
AGENTS.md
Guidance for AI coding agents working in this repository.
What this is
An Omarchy shell plugin (kcotugno.qmk-rgb) that controls QMK keyboard RGB
lighting over the VIA raw HID protocol. The repo root is the plugin root:
omarchy plugin add clones it straight into
~/.config/omarchy/plugins/kcotugno.qmk-rgb/.
| File | Role |
|---|---|
manifest.json |
Plugin manifest (bar-widget), settings schema and defaults. |
Panel.qml |
Bar button and popout panel. Holds no protocol logic; it shells out to the backend. |
qmk_rgb.py |
Backend CLI. Discovery, VIA protocol, JSON output. Standard library only. |
effects/<vid>-<pid>.json |
Per-keyboard effect names (VIA dropdown format, index = effect number). See README "Effect names". |
effects/presets/*.json |
Shared effect lists that keyboard files reference with "preset". |
tests/test_qmk_rgb.py |
Unit tests against a fake firmware that mimics QMK's via.c. |
Rules
- Git commits: do not add
Co-Authored-By:trailers (or any other AI/agent attribution trailers) to commit messages. Commits are authored by the human maintainer only. - Keep
qmk_rgb.pydependency-free (Python standard library only). Users install the plugin with agit clone; there is no package step. - Every backend command prints exactly one JSON document on stdout, or
{"error": "..."}with a non-zero exit.Panel.qmlparses that output, so treat the JSON shape as an API. The one exception isudev-rule, which prints the rule text. - Don't write to EEPROM (
save/--save) on every change; the panel debounces saves on purpose. - Effect names belong in mapping files under
effects/, not in code. Every mapping needs asourceURL. Take names from the keyboard's VIA definition, or from VIA's built-in menus in the-via/reader. Don't guess them. Per-effectcontrolsmust come from reading the effect's firmware source (or the definition'sshowIfrules); cite it incontrolsSource. - Plugin folders may not contain symlinks (
omarchy plugin validaterefuses them). - QML follows Omarchy's shell conventions: import
qs.Commons as Commonsand useCommons.Color, size withStyle.space()/Style.font.*, and build fromqs.Uicomponents (Panel,KeyboardPanel,PanelSlider,Button, ...). Look at$OMARCHY_PATH/shell/plugins/panels/for patterns.
Checks
python3 -m unittest discover -s tests
omarchy plugin validate .
When you change Panel.qml, also load it in the shell. The checkout may be
symlinked as ~/.config/omarchy/plugins/kcotugno.qmk-rgb. File watching does
not follow that link, and omarchy-shell shell rescanPlugins keeps the
already-loaded Panel.qml, so run omarchy restart shell after editing. Then
check the shell log for QML errors
(quickshell log -p "$OMARCHY_PATH/shell" | grep qmk-rgb).
When testing against real hardware, don't use --save unless you mean to.
Unsaved changes revert when the keyboard is unplugged.
