Skip to content

Add Framework 16 RGB keyboard theme syncing#4524

Open
godlewski wants to merge 4 commits intobasecamp:devfrom
godlewski:framework16-rgb-support
Open

Add Framework 16 RGB keyboard theme syncing#4524
godlewski wants to merge 4 commits intobasecamp:devfrom
godlewski:framework16-rgb-support

Conversation

@godlewski
Copy link

@godlewski godlewski commented Feb 6, 2026

Summary

Syncs the omarchy theme accent color to the Framework Laptop 16 RGB keyboard via qmk_hid, following the same pattern as the existing ASUS ROG integration with asusctl.

  • Detects Framework 16 hardware via DMI data
  • Auto-installs qmk-hid from AUR on Framework 16 machines
  • Installs a udev rule so qmk_hid can access the keyboard without root
  • Converts the theme's hex accent color to QMK's HSV format using Python's colorsys
  • Sets solid color effect with the accent hue/saturation and persists via --save

New files

  • bin/omarchy-hw-framework16 — hardware detection via DMI
  • bin/omarchy-theme-set-framework16 — applies accent color to keyboard RGB
  • default/themed/framework16-kbd.rgb.tpl — accent color template
  • install/packaging/framework16.sh — conditional qmk-hid AUR package install
  • install/config/hardware/framework16-qmk-hid.sh — udev rule for unprivileged HID access

Modified files

  • bin/omarchy-theme-set — calls omarchy-theme-set-framework16 during theme application
  • install/packaging/all.sh — registers the Framework 16 packaging script
  • install/config/all.sh — registers the udev rule setup during install

Tested on hardware

All testing done on a Framework Laptop 16 (AMD Ryzen 7040 Series) with ANSI keyboard module (FW 0.3.1).

  • Hardware detectionomarchy-hw-framework16 correctly identifies the machine via DMI vendor and product name
  • Package installqmk-hid installs from AUR via omarchy-pkg-aur-add and yay
  • Keyboard communicationqmk_hid -l finds the keyboard (32ac:0012, "Laptop 16 Keyboard Module - ANSI")
  • Hex-to-HSV conversion — verified against known colors (red, green, blue, white, orange), all values match expected QMK HSV output
  • Theme switching — visually confirmed keyboard color changes when switching themes (ristretto coral → hackerman green → pure blue)
  • Graceful no-op — exits cleanly with no output when qmk_hid is not installed or the theme file is missing
  • Sleep/wake persistence — color survives sleep/wake cycles via --save (persists to keyboard EEPROM)
  • Install flow simulation — ran both scripts through run_logged with the same env vars and execution path as install.sh to confirm they resolve paths correctly

DEMO

trim.C9E3D34A-C610-46C1-BBBC-B628B64145A5.MOV

@godlewski godlewski force-pushed the framework16-rgb-support branch 3 times, most recently from 0732f72 to a7b2759 Compare February 7, 2026 00:29
@godlewski godlewski marked this pull request as ready for review February 7, 2026 00:49
@dhh
Copy link
Member

dhh commented Feb 7, 2026

Nice! Let's make omarchy-theme-set-keyboard and then have that call omarchy-theme-set-keyboard-asus-rog and omarchy-theme-set-keyboard-f16. We also need a migration to install this on existing machines.

@godlewski godlewski force-pushed the framework16-rgb-support branch from 1d2f8f2 to 295751e Compare February 7, 2026 16:52
@godlewski
Copy link
Author

@dhh I updated the PR with omarchy-theme-set-keyboard as a dispatcher that calls omarchy-theme-set-keyboard-asus-rog and omarchy-theme-set-keyboard-f16 as you suggested!

Also added the migration for existing Framework 16 machines.

I retested on my Framework 16:

  • Keyboard RGB changes color when switching themes
  • Migration installs qmk-hid, creates the udev rule, and is idempotent on re-run

@@ -0,0 +1,3 @@
if omarchy-hw-framework16; then
omarchy-pkg-aur-add qmk-hid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't actually install yay packages during initial setup, as we're running an offline installer. So we need to get qmk-hid built for the Omarchy Package Repository. You can open a PR here: https://github.com/omacom-io/omarchy-pkgs/

if omarchy-hw-framework16; then
if [[ ! -f /etc/udev/rules.d/50-framework16-qmk-hid.rules ]]; then
cat <<EOF | sudo tee /etc/udev/rules.d/50-framework16-qmk-hid.rules
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", MODE="0660", TAG+="uaccess"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put this file into default/udev/framework16-qmk-hid.rules, then copy it over when installing. Because then we can reuse for migration and better track all the files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants