From 2a81068d8a60942c7d0a4a26501ce9079f21b48c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 26 Mar 2026 09:23:59 +0100 Subject: [PATCH] Extract omarchy-hw-match --- bin/omarchy-hw-framework16 | 2 +- bin/omarchy-hw-match | 6 ++++++ bin/omarchy-hw-surface | 2 +- .../fix-xps-haptic-touchpad.sh} | 0 .../fix-ptl-display.sh => dell/fix-xps-ptl-display.sh} | 0 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 bin/omarchy-hw-match rename install/config/hardware/{fix-dell-xps-haptic-touchpad.sh => dell/fix-xps-haptic-touchpad.sh} (100%) rename install/config/hardware/{intel/fix-ptl-display.sh => dell/fix-xps-ptl-display.sh} (100%) diff --git a/bin/omarchy-hw-framework16 b/bin/omarchy-hw-framework16 index d1e03c1d..cd746bb1 100755 --- a/bin/omarchy-hw-framework16 +++ b/bin/omarchy-hw-framework16 @@ -3,4 +3,4 @@ # 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 + omarchy-hw-match "Laptop 16" diff --git a/bin/omarchy-hw-match b/bin/omarchy-hw-match new file mode 100755 index 00000000..ae3eb44d --- /dev/null +++ b/bin/omarchy-hw-match @@ -0,0 +1,6 @@ +#!/bin/bash + +# Match against the computer's DMI product name (case-insensitive). +# Usage: omarchy-hw-match "XPS" + +grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null diff --git a/bin/omarchy-hw-surface b/bin/omarchy-hw-surface index 653792da..2f642721 100755 --- a/bin/omarchy-hw-surface +++ b/bin/omarchy-hw-surface @@ -3,4 +3,4 @@ # Detect whether the computer is a Microsoft Surface device. [[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] && - grep -q "Surface" /sys/class/dmi/id/product_name 2>/dev/null + omarchy-hw-match "Surface" diff --git a/install/config/hardware/fix-dell-xps-haptic-touchpad.sh b/install/config/hardware/dell/fix-xps-haptic-touchpad.sh similarity index 100% rename from install/config/hardware/fix-dell-xps-haptic-touchpad.sh rename to install/config/hardware/dell/fix-xps-haptic-touchpad.sh diff --git a/install/config/hardware/intel/fix-ptl-display.sh b/install/config/hardware/dell/fix-xps-ptl-display.sh similarity index 100% rename from install/config/hardware/intel/fix-ptl-display.sh rename to install/config/hardware/dell/fix-xps-ptl-display.sh