From e487dace4359909f1752d0077fdf36d030b7fa40 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 5 Feb 2026 09:23:00 +0100 Subject: [PATCH] Install asusctl on ROG machines to get out-of-the-box keyboard light sync --- bin/omarchy-hw-asus-rog | 6 ++++++ install/config/hardware/fix-asus-rog-audio-mixer.sh | 4 +--- install/config/hardware/fix-asus-rog-mic.sh | 4 +--- install/omarchy-other.packages | 1 + install/packaging/all.sh | 1 + install/packaging/asus-rog.sh | 3 +++ migrations/1768916735.sh | 3 +-- 7 files changed, 14 insertions(+), 8 deletions(-) create mode 100755 bin/omarchy-hw-asus-rog create mode 100644 install/packaging/asus-rog.sh diff --git a/bin/omarchy-hw-asus-rog b/bin/omarchy-hw-asus-rog new file mode 100755 index 00000000..3a0e27af --- /dev/null +++ b/bin/omarchy-hw-asus-rog @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether the computer is an Asus ROG machine. + +[[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "ASUSTeK COMPUTER INC." ]] && + grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null diff --git a/install/config/hardware/fix-asus-rog-audio-mixer.sh b/install/config/hardware/fix-asus-rog-audio-mixer.sh index 7d36a7e9..31401317 100644 --- a/install/config/hardware/fix-asus-rog-audio-mixer.sh +++ b/install/config/hardware/fix-asus-rog-audio-mixer.sh @@ -1,8 +1,6 @@ # Fix audio volume on Asus ROG laptops by using a soft mixer. -if [[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "ASUSTeK COMPUTER INC." ]] && - grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null; then - +if omarchy-hw-asus-rog; then mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ cp $OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/alsa-soft-mixer.conf ~/.config/wireplumber/wireplumber.conf.d/ rm -rf ~/.local/state/wireplumber/default-routes diff --git a/install/config/hardware/fix-asus-rog-mic.sh b/install/config/hardware/fix-asus-rog-mic.sh index b7391a2c..c50a63f1 100644 --- a/install/config/hardware/fix-asus-rog-mic.sh +++ b/install/config/hardware/fix-asus-rog-mic.sh @@ -2,9 +2,7 @@ # The mic boost is way too high by default, causing clipping. # Sets levels and stores ALSA state so it persists across reboots. -if [[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "ASUSTeK COMPUTER INC." ]] && - grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null; then - +if omarchy-hw-asus-rog; then for card in /proc/asound/card*/codec*; do if grep -q "ALC285" "$card" 2>/dev/null; then cardnum=$(echo "$card" | grep -oP 'card\K\d+') diff --git a/install/omarchy-other.packages b/install/omarchy-other.packages index 36da7507..f4590f5f 100644 --- a/install/omarchy-other.packages +++ b/install/omarchy-other.packages @@ -2,6 +2,7 @@ # Utilized by ISO builder to ensure package availability in the ISO autoconf-archive +asusctl base base-devel broadcom-wl diff --git a/install/packaging/all.sh b/install/packaging/all.sh index a28c3963..1bdc912f 100644 --- a/install/packaging/all.sh +++ b/install/packaging/all.sh @@ -4,3 +4,4 @@ run_logged $OMARCHY_INSTALL/packaging/nvim.sh 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 diff --git a/install/packaging/asus-rog.sh b/install/packaging/asus-rog.sh new file mode 100644 index 00000000..6eab5853 --- /dev/null +++ b/install/packaging/asus-rog.sh @@ -0,0 +1,3 @@ +if omarchy-hw-asus-rog; then + omarchy-pkg-add asusctl +fi diff --git a/migrations/1768916735.sh b/migrations/1768916735.sh index dd0759d1..0c5c6408 100644 --- a/migrations/1768916735.sh +++ b/migrations/1768916735.sh @@ -3,7 +3,6 @@ echo "Fix microphone gain and audio mixing on Asus ROG laptops" source "$OMARCHY_PATH/install/config/hardware/fix-asus-rog-mic.sh" source "$OMARCHY_PATH/install/config/hardware/fix-asus-rog-audio-mixer.sh" -if [[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "ASUSTeK COMPUTER INC." ]] && - grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null; then +if omarchy-hw-asus-rog; then omarchy-restart-pipewire fi