mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
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:
Executable
+6
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Executable
+4
@@ -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)
|
||||
Executable
+22
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", MODE="0660", TAG+="uaccess"
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
if omarchy-hw-framework16; then
|
||||
omarchy-pkg-add qmk-hid
|
||||
fi
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user