Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

glow

Drive a VIA/QMK keyboard's RGB from the host — and give your coding agent a physical presence on your desk.

glow sets your keyboard's RGB matrix to a solid color by talking to its VIA raw-HID interface directly. No firmware flashing, no VIA app open, no daemon — just a command:

glow purple
glow green
glow hue 96 # any hue on QMK's 0-255 wheel

It started as a joke — I bought a Keychron Q0 Mini, which is basically one giant key. Then I saw Work Louder x OpenAI's Co-Lab, where the keyboard's light reflects the AI's state, thought "huh, how hard could that beee," and this is the result: the big button now glows with what Claude is doing.

The Claude status lamp

Wire glow to Claude Code hooks and your keyboard becomes a live status light:

Claude Code eventcolormeaning
SessionStartpurpleidle / ready
UserPromptSubmitblueworking
Stopgreenyour turn
Notificationorangeneeds your input

Glance at it from across the room and you know Claude's state without looking at the screen. Add to ~/.claude/settings.json:

{
"hooks": {
"SessionStart": [{ "hooks": [{ "type": "command", "command": "/path/to/glow/glow-hook purple" }] }],
"UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "/path/to/glow/glow-hook blue" }] }],
"Stop": [{ "hooks": [{ "type": "command", "command": "/path/to/glow/glow-hook green" }] }],
"Notification": [{ "hooks": [{ "type": "command", "command": "/path/to/glow/glow-hook orange" }] }]
}
}

glow-hook runs glow backgrounded and never errors your session (an unplugged keyboard just does nothing). It's not Claude-specific — anything that can run a command can drive the light: CI status, a build, a pomodoro, a deploy.

Requirements

  • A QMK keyboard with VIA + RGB matrix enabled (most Keychron Q/V/K boards qualify). glow talks to the VIA raw-HID interface (USB HID usage page 0xFF60), so nothing needs flashing.

  • Python 3 with hidapi. The glow wrapper runs directly if hid imports, otherwise falls back to a nix-shell -p that provides it.

  • Permission to open the raw HID device. On Linux the device is usually root-owned; add a udev rule for your keyboard's vendor id, e.g.:

    # /etc/udev/rules.d/99-glow.rules (replace 3434 with your vendor id)
    KERNEL=="hidraw*", ATTRS{idVendor}=="3434", MODE="0660", GROUP="input", TAG+="uaccess"
    

    and be in the input group. Reload with udevadm control --reload && udevadm trigger.

Targeting your keyboard

Defaults target the Keychron Q0 Mini 8K (3434:040b). For another board, find its id with lsusb and set:

GLOW_VID=0x3434 GLOW_PID=0x040b glow purple

How it works

QMK's VIA feature exposes a raw-HID interface (usage page 0xFF60) that the VIA app uses to configure the board live. glow speaks the same protocol. To set a solid color it sends rgb_matrix commands:

report = [0x00, cmd, channel, value_id, ...args] # padded to 33 bytes
cmd 0x07 = set, 0x09 = save
channel 0x03 = rgb_matrix
value_id 1 = brightness, 2 = effect, 4 = color(hue, sat)
effect 1 = RGB_MATRIX_SOLID_COLOR

The one gotcha that cost an hour: value_id 3 is effect speed, not effect. Send the effect to id 3 and the color changes but the animation never stops — the effect id is 2 (see qmk/via.h).

License

MIT

About

Drive a VIA/QMK keyboard's RGB from the host - and give your coding agent a physical presence on your desk

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages