Merge pull request #8 from boboidream/master

[!] 修复 macOS 10.13.6 下不能获取到 VendorID,ProductID,EDID 问题
This commit is contained in:
ZeRo Xu 2018-09-04 19:40:16 +08:00 committed by GitHub
commit 18a7128d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -16,9 +16,9 @@ cat << EEF
============================================ ============================================
EEF EEF
# #
VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $8}') VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $NF}')
ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $8}') ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $NF}')
EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $8}' | sed -e 's/.$//' -e 's/^.//') EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $NF}' | sed -e 's/.$//' -e 's/^.//')
Vid=$(echo "obase=16;$VendorID" | bc | tr 'A-Z' 'a-z') Vid=$(echo "obase=16;$VendorID" | bc | tr 'A-Z' 'a-z')
Pid=$(echo "obase=16;$ProductID" | bc | tr 'A-Z' 'a-z') Pid=$(echo "obase=16;$ProductID" | bc | tr 'A-Z' 'a-z')

View file

@ -16,9 +16,9 @@ cat << EEF
============================================ ============================================
EEF EEF
# #
VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $8}') VendorID=$(ioreg -l | grep "DisplayVendorID" | awk '{print $NF}')
ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $8}') ProductID=$(ioreg -l | grep "DisplayProductID" | awk '{print $NF}')
EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $8}' | sed -e 's/.$//' -e 's/^.//') EDID=$(ioreg -l | grep "IODisplayEDID" | awk '{print $NF}' | sed -e 's/.$//' -e 's/^.//')
Vid=$(echo "obase=16;$VendorID" | bc | tr 'A-Z' 'a-z') Vid=$(echo "obase=16;$VendorID" | bc | tr 'A-Z' 'a-z')
Pid=$(echo "obase=16;$ProductID" | bc | tr 'A-Z' 'a-z') Pid=$(echo "obase=16;$ProductID" | bc | tr 'A-Z' 'a-z')