diff --git a/bin/omarchy-hw-surface b/bin/omarchy-hw-surface new file mode 100755 index 00000000..653792da --- /dev/null +++ b/bin/omarchy-hw-surface @@ -0,0 +1,6 @@ +#!/bin/bash + +# 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 diff --git a/install/config/hardware/fix-surface-keyboard.sh b/install/config/hardware/fix-surface-keyboard.sh index 6c379337..2211db62 100644 --- a/install/config/hardware/fix-surface-keyboard.sh +++ b/install/config/hardware/fix-surface-keyboard.sh @@ -1,8 +1,8 @@ # Detect Surface devices which require additional modules for the keyboard to work. # Module list derived from Chris McLeod's manual install instructions # https://chrismcleod.dev/blog/installing-arch-linux-with-secure-boot-on-a-microsoft-surface-laptop-studio/ -product_name="$(cat /sys/class/dmi/id/product_name 2>/dev/null)" -if [[ $product_name =~ Surface ]]; then +if omarchy-hw-surface; then + product_name="$(cat /sys/class/dmi/id/product_name 2>/dev/null)" echo "Detected Surface Device" # Modules already exist in the rootfs for the default kernel. diff --git a/install/omarchy-other.packages b/install/omarchy-other.packages index bec02782..4fc49d8b 100644 --- a/install/omarchy-other.packages +++ b/install/omarchy-other.packages @@ -53,6 +53,9 @@ vulkan-intel vulkan-radeon vulkan-asahi +# Surface laptop support packages +linux-firmware-marvell + # T2 MacBook support packages apple-bcm-firmware apple-t2-audio-config diff --git a/install/packaging/all.sh b/install/packaging/all.sh index 9d86078b..16e6404a 100644 --- a/install/packaging/all.sh +++ b/install/packaging/all.sh @@ -6,3 +6,4 @@ 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 +run_logged $OMARCHY_INSTALL/packaging/surface.sh diff --git a/install/packaging/surface.sh b/install/packaging/surface.sh new file mode 100644 index 00000000..e764f39a --- /dev/null +++ b/install/packaging/surface.sh @@ -0,0 +1,3 @@ +if omarchy-hw-surface; then + omarchy-pkg-add linux-firmware-marvell +fi