Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
File renamed without changes.
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/framework16-kbd.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 change: 1 addition & 0 deletions default/themed/framework16-kbd.rgb.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ accent }}
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
12 changes: 12 additions & 0 deletions install/config/hardware/framework16-qmk-hid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
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"
EOF

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-aur-add qmk-hid
fi
14 changes: 14 additions & 0 deletions migrations/1770483021.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
echo "Install Framework 16 keyboard RGB support"

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

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"
EOF

sudo udevadm control --reload-rules
sudo udevadm trigger
fi
fi