Add Framework 16 RGB keyboard theme syncing (#4524)

* Add framwork 16 RGB syncing

* fixed install script, fixed color changing when style changes

* added framework scripts to the main install scripts

* renamed theme-set scripts, added migration

* use omarchy-pkg-add, shared keyboard template, tracked udev rule

* call the install file from the migration file
This commit is contained in:
Steve Godlewski
2026-02-18 21:19:30 +01:00
committed by GitHub
parent 5f978a9ea9
commit 43ae186a80
12 changed files with 53 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Detect whether the computer is a Framework Laptop 16.
[[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "Framework" ]] &&
grep -q "Laptop 16" /sys/class/dmi/id/product_name 2>/dev/null
+1 -1
View File
@@ -57,7 +57,7 @@ omarchy-theme-set-gnome
omarchy-theme-set-browser
omarchy-theme-set-vscode
omarchy-theme-set-obsidian
omarchy-theme-set-asusctl
omarchy-theme-set-keyboard
# Call hook on theme set
omarchy-hook theme-set "$THEME_NAME"
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
omarchy-theme-set-keyboard-asus-rog
omarchy-theme-set-keyboard-f16
@@ -1,6 +1,6 @@
#!/bin/bash
ASUSCTL_THEME=~/.config/omarchy/current/theme/asusctl.rgb
ASUSCTL_THEME=~/.config/omarchy/current/theme/keyboard.rgb
if omarchy-cmd-present asusctl; then
asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME)
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
FRAMEWORK16_THEME=~/.config/omarchy/current/theme/keyboard.rgb
if omarchy-cmd-present qmk_hid && [[ -f "$FRAMEWORK16_THEME" ]]; then
hex=$(cat "$FRAMEWORK16_THEME")
hex="${hex#\#}"
# Convert hex to QMK HSV (0-255 scale) using Python's colorsys
read -r h s <<< $(python3 -c "
import colorsys
r, g, b = int('$hex'[:2],16)/255, int('$hex'[2:4],16)/255, int('$hex'[4:6],16)/255
h, s, v = colorsys.rgb_to_hsv(r, g, b)
print(int(h * 255), int(s * 255))
")
qmk_hid via --rgb-effect 1 2>/dev/null
qmk_hid via --rgb-hue "$h" 2>/dev/null
qmk_hid via --rgb-saturation "$s" 2>/dev/null
qmk_hid via --rgb-brightness 100 2>/dev/null
qmk_hid via --save 2>/dev/null
fi
+1
View File
@@ -0,0 +1 @@
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", MODE="0660", TAG+="uaccess"
+1
View File
@@ -41,3 +41,4 @@ run_logged $OMARCHY_INSTALL/config/hardware/fix-asus-rog-audio-mixer.sh
run_logged $OMARCHY_INSTALL/config/hardware/fix-asus-rog-mic.sh
run_logged $OMARCHY_INSTALL/config/hardware/fix-yt6801-ethernet-adapter.sh
run_logged $OMARCHY_INSTALL/config/hardware/fix-synaptic-touchpad.sh
run_logged $OMARCHY_INSTALL/config/hardware/framework16-qmk-hid.sh
@@ -0,0 +1,9 @@
# Allow unprivileged access to the Framework 16 keyboard for RGB control via qmk_hid.
if omarchy-hw-framework16; then
if [[ ! -f /etc/udev/rules.d/50-framework16-qmk-hid.rules ]]; then
sudo cp "$OMARCHY_PATH/default/udev/framework16-qmk-hid.rules" /etc/udev/rules.d/50-framework16-qmk-hid.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
fi
fi
+1
View File
@@ -5,3 +5,4 @@ run_logged $OMARCHY_INSTALL/packaging/icons.sh
run_logged $OMARCHY_INSTALL/packaging/webapps.sh
run_logged $OMARCHY_INSTALL/packaging/tuis.sh
run_logged $OMARCHY_INSTALL/packaging/asus-rog.sh
run_logged $OMARCHY_INSTALL/packaging/framework16.sh
+3
View File
@@ -0,0 +1,3 @@
if omarchy-hw-framework16; then
omarchy-pkg-add qmk-hid
fi
+4
View File
@@ -0,0 +1,4 @@
echo "Install Framework 16 keyboard RGB support"
source $OMARCHY_PATH/install/packaging/framework16.sh
source $OMARCHY_PATH/install/config/hardware/framework16-qmk-hid.sh