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-framework-desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Detect whether the computer is a Framework Desktop.

[[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "Framework" ]] &&
grep -q "Desktop" /sys/class/dmi/id/product_name 2>/dev/null
1 change: 1 addition & 0 deletions bin/omarchy-theme-set
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ omarchy-theme-set-browser
omarchy-theme-set-vscode
omarchy-theme-set-obsidian
omarchy-theme-set-asusctl
omarchy-theme-set-fan

# Call hook on theme set
omarchy-hook theme-set "$THEME_NAME"
8 changes: 8 additions & 0 deletions bin/omarchy-theme-set-fan
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Unified fan RGB theme setter.
# Calls hardware-specific fan RGB setters.

omarchy-theme-set-fan-framework-desktop

# Add other fan RGB implementations here as needed.
43 changes: 43 additions & 0 deletions bin/omarchy-theme-set-fan-framework-desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Apply theme accent color to Framework Desktop ARGB fan via framework_tool.
#
# Color selection priority:
# 1. User override: ~/.config/omarchy/fan-colors/<theme-name>.txt (8 hex colors, one per line)
# 2. Theme accent color

if ! omarchy-hw-framework-desktop || ! omarchy-cmd-present framework_tool; then
exit 0
fi

THEME_NAME=$(cat ~/.config/omarchy/current/theme.name 2>/dev/null)
OVERRIDE_FILE=~/.config/omarchy/fan-colors/${THEME_NAME}.txt
THEME_FILE=~/.config/omarchy/current/theme/framework-desktop-fan.rgb

# Check for user override first
if [[ -f "$OVERRIDE_FILE" ]]; then
# Read 8 colors from override file (one hex color per line)
mapfile -t colors < "$OVERRIDE_FILE"

# Pad with first color if fewer than 8 provided
while [[ ${#colors[@]} -lt 8 ]]; do
colors+=("${colors[0]}")
done

# Convert # to 0x prefix
for i in {0..7}; do
colors[$i]=$(echo "${colors[$i]}" | sed 's/^#/0x/')
done

sudo framework_tool --rgbkbd 0 \
"${colors[0]}" "${colors[1]}" "${colors[2]}" "${colors[3]}" \
"${colors[4]}" "${colors[5]}" "${colors[6]}" "${colors[7]}" \
2>/dev/null || true
exit 0
fi

# Use theme accent color directly
if [[ -f "$THEME_FILE" ]]; then
color=$(sed 's/^#/0x/' "$THEME_FILE")
sudo framework_tool --rgbkbd 0 "$color" "$color" "$color" "$color" "$color" "$color" "$color" "$color" 2>/dev/null || true
fi
1 change: 1 addition & 0 deletions default/hypr/autostart.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exec-once = uwsm-app -- swaybg -i ~/.config/omarchy/current/background -m fill
exec-once = uwsm-app -- swayosd-server
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = omarchy-cmd-first-run
exec-once = omarchy-theme-set-fan

# Slow app launch fix -- set systemd vars
exec-once = systemctl --user import-environment $(env | cut -d'=' -f 1)
Expand Down
1 change: 1 addition & 0 deletions default/themed/framework-desktop-fan.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/framework-desktop-argb.sh
10 changes: 10 additions & 0 deletions install/config/hardware/framework-desktop-argb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set up passwordless sudo for framework_tool on Framework Desktop.
# Required because framework_tool reads SMBIOS data which requires root,
# even for simple RGB control operations.

if omarchy-hw-framework-desktop; then
if [[ ! -f /etc/sudoers.d/framework-tool ]]; then
echo "$USER ALL=(ALL) NOPASSWD: /usr/bin/framework_tool" | sudo tee /etc/sudoers.d/framework-tool > /dev/null
sudo chmod 440 /etc/sudoers.d/framework-tool
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/framework-desktop.sh
3 changes: 3 additions & 0 deletions install/packaging/framework-desktop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if omarchy-hw-framework-desktop; then
omarchy-pkg-add framework-system
fi
10 changes: 10 additions & 0 deletions migrations/1770478375.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo "Install framework-system and configure sudoers for Framework Desktop ARGB fan control"

if omarchy-hw-framework-desktop; then
omarchy-pkg-add framework-system

if [[ ! -f /etc/sudoers.d/framework-tool ]]; then
echo "$USER ALL=(ALL) NOPASSWD: /usr/bin/framework_tool" | sudo tee /etc/sudoers.d/framework-tool > /dev/null
sudo chmod 440 /etc/sudoers.d/framework-tool
fi
fi