Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/omarchy-hw-framework16
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion bin/omarchy-theme-set
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 4 additions & 0 deletions bin/omarchy-theme-set-keyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

omarchy-theme-set-keyboard-asus-rog
omarchy-theme-set-keyboard-f16
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
22 changes: 22 additions & 0 deletions bin/omarchy-theme-set-keyboard-f16
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
1 change: 1 addition & 0 deletions default/udev/framework16-qmk-hid.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", MODE="0660", TAG+="uaccess"
1 change: 1 addition & 0 deletions install/config/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,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
9 changes: 9 additions & 0 deletions install/config/hardware/framework16-qmk-hid.sh
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions install/packaging/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 3 additions & 0 deletions install/packaging/framework16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if omarchy-hw-framework16; then
omarchy-pkg-add qmk-hid
fi
11 changes: 11 additions & 0 deletions migrations/1770483021.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Install Framework 16 keyboard RGB support"

if omarchy-hw-framework16; then
omarchy-pkg-add qmk-hid

if [[ ! -f /etc/udev/rules.d/50-framework16-qmk-hid.rules ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

You can call the install file from here so we don't need to duplicate this logic.

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