From 85357f7e300a220f2b62160165627992222cf910 Mon Sep 17 00:00:00 2001 From: xzhih Date: Tue, 28 May 2024 16:44:07 +0800 Subject: [PATCH] =?UTF-8?q?merge=20#245=EF=BC=8Cunhide=20built-in=20monito?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hidpi.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index eb25dd4..f9c368f 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -222,11 +222,15 @@ function get_vidpid_applesilicon() { local prodNameQuery="$prodAttrsQuery$prodname$value$get" # Get VIDs, PIDs, Prodnames - local vends=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$vendIDQuery")) - local prods=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodIDQuery")) + # local vends=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$vendIDQuery")) + # local prods=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodIDQuery")) + + local vends=($(ioreg -l | grep "DisplayAttributes" | sed -n 's/.*"LegacyManufacturerID"=\([0-9]*\).*/\1/p')) + local prods=($(ioreg -l | grep "DisplayAttributes" | sed -n 's/.*"ProductID"=\([0-9]*\).*/\1/p')) set -o noglob - IFS=$'\n' prodnames=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodNameQuery")) + # IFS=$'\n' prodnames=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodNameQuery")) + IFS=$'\n' prodnames=($(ioreg -l | grep "DisplayAttributes" | sed -n 's/.*"ProductName"="\([^"]*\)".*/\1/p')) set +o noglob if [[ "${#prods[@]}" -ge 2 ]]; then