From f8b858e7bda827b7bb6ae76615853dd71be1a4c4 Mon Sep 17 00:00:00 2001 From: xzhih Date: Fri, 6 Aug 2021 10:10:57 +0800 Subject: [PATCH] Processing output --- hidpi.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index 4d2c406..0924e04 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -102,7 +102,7 @@ function get_edid() { let index++ MonitorName=("$(echo ${display:190:24} | xxd -p -r)") VendorID=${display:16:4} - ProductID=${gMonitor:22:2}${gMonitor:20:2} + ProductID=${display:22:2}${display:20:2} if [[ ${VendorID} == 0610 ]]; then MonitorName="Apple Display" @@ -197,7 +197,7 @@ function get_edid() { echo '------------------------------------' for display in "${gDisplayInf[@]}"; do let index++ - printf " %d | ${display:16:4} | ${gMonitor:22:2}${gMonitor:20:2}\n" $index + printf " %d | ${display:16:4} | ${display:22:2}${display:20:2}\n" $index done echo '------------------------------------' read -p "Choose the display: " selection @@ -530,7 +530,9 @@ function enable_hidpi_with_patch() { newedid=${EDID:0:38}0490${EDID:42:6}e6${EDID:50:204}${newchecksum} EDid=$(printf ${newedid} | xxd -r -p | base64) - /usr/bin/sed -i "" "s:EDid:${EDid}:g" ${dpiFile} + # /usr/bin/sed -i "" "s:EDid:${EDid}:g" ${dpiFile} + fullConfig=$(/usr/bin/sed "s:EDid:${EDid}:g" ${dpiFile}) + echo "${fullConfig}" > "${dpiFile}" end }