diff --git a/hidpi-zh.sh b/hidpi-zh.sh index 255152e..02e0357 100755 --- a/hidpi-zh.sh +++ b/hidpi-zh.sh @@ -16,9 +16,9 @@ cat << EEF ============================================ EEF # - VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $8}') - ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $8}') - EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $8}' | sed -e 's/.$//' -e 's/^.//') + VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $NF}') + ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $NF}') + EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $NF}' | sed -e 's/.$//' -e 's/^.//') Vid=$(echo "obase=16;$VendorID" | bc | tr 'A-Z' 'a-z') Pid=$(echo "obase=16;$ProductID" | bc | tr 'A-Z' 'a-z') diff --git a/hidpi.sh b/hidpi.sh index 70c98cd..5a2a75f 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -16,9 +16,9 @@ cat << EEF ============================================ EEF # - VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $8}') - ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $8}') - EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $8}' | sed -e 's/.$//' -e 's/^.//') + VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $NF}') + ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $NF}') + EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $NF}' | sed -e 's/.$//' -e 's/^.//') Vid=$(echo "obase=16;$VendorID" | bc | tr 'A-Z' 'a-z') Pid=$(echo "obase=16;$ProductID" | bc | tr 'A-Z' 'a-z')