diff --git a/hidpi.sh b/hidpi.sh index fe6d949..eb25dd4 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -222,15 +222,11 @@ 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 -l | grep "DisplayAttributes" | tail -n +2 | sed -n 's/.*"LegacyManufacturerID"=\([0-9]*\).*/\1/p')) - local prods=($(ioreg -l | grep "DisplayAttributes" | tail -n +2 | sed -n 's/.*"ProductID"=\([0-9]*\).*/\1/p')) + local vends=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$vendIDQuery")) + local prods=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodIDQuery")) set -o noglob - # IFS=$'\n' prodnames=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodNameQuery")) - IFS=$'\n' prodnames=($(ioreg -l | grep "DisplayAttributes" | tail -n +2 | sed -n 's/.*"ProductName"="\([^"]*\)".*/\1/p')) + IFS=$'\n' prodnames=($(ioreg -arw0 -d1 -c $appleDisplClass | xpath -q -n -e "$prodNameQuery")) set +o noglob if [[ "${#prods[@]}" -ge 2 ]]; then