From 76955562d4132b7f496a9f4b91e17b308c43cdfb Mon Sep 17 00:00:00 2001 From: hjmmc Date: Fri, 17 Apr 2020 14:22:20 +0800 Subject: [PATCH 1/8] fix sip status --- hidpi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hidpi.sh b/hidpi.sh index 3fbb520..7fe31a9 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -72,7 +72,7 @@ downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/master" # downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/dev" # downloadHost="http://127.0.0.1:8080" -if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]]; then +if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled" ]]; then : else echo "${disableSIP}"; From 9074fdf31bff8ce70547feff04c86174372ebb5e Mon Sep 17 00:00:00 2001 From: hjmmc Date: Fri, 17 Apr 2020 17:14:23 +0800 Subject: [PATCH 2/8] add local mode support --- hidpi.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hidpi.sh b/hidpi.sh index 7fe31a9..3db6411 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -5,6 +5,8 @@ systemVersion=($(sw_vers -productVersion | cut -d "." -f 2)) systemLanguage=($(locale | grep LANG | sed s/'LANG='// | tr -d '"' | cut -d "." -f 1)) disableSIP="Need to disable SIP" +langRemoteMode="Remote Mode" +langLocalMode="Local Mode" langDisplay="Display" langMonitors="Monitors" langIndex="Index" @@ -37,6 +39,8 @@ langChooseResOpCustom="(6) Manual input resolution" if [[ "${systemLanguage}" == "zh_CN" ]]; then disableSIP="需要关闭 SIP" + langRemoteMode="远程模式" + langLocalMode="本地模式" langDisplay="显示器" langMonitors="显示器" langIndex="序号" @@ -72,6 +76,15 @@ downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/master" # downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/dev" # downloadHost="http://127.0.0.1:8080" +shellDir="$( cd "$( dirname "$0" )" && pwd )" + +if [ -d "${shellDir}/displayIcons" ];then + echo $langLocalMode + downloadHost="fiel://${shellDir}" +else + echo $langRemoteMode +fi + if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled" ]]; then : else From 8aeb90d5ace254e1bf6ef8428ec88a44092fc5dd Mon Sep 17 00:00:00 2001 From: hjmmc Date: Fri, 17 Apr 2020 17:24:12 +0800 Subject: [PATCH 3/8] add local mode support --- hidpi.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index 3db6411..f08eeef 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -76,11 +76,11 @@ downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/master" # downloadHost="https://raw.githubusercontent.com/xzhih/one-key-hidpi/dev" # downloadHost="http://127.0.0.1:8080" -shellDir="$( cd "$( dirname "$0" )" && pwd )" +shellDir="$(dirname $0)" if [ -d "${shellDir}/displayIcons" ];then echo $langLocalMode - downloadHost="fiel://${shellDir}" + downloadHost="file://${shellDir}" else echo $langRemoteMode fi From 4d0af8a1511c48a880b9fdf737d4157ed10ef181 Mon Sep 17 00:00:00 2001 From: hjmmc Date: Fri, 17 Apr 2020 17:36:57 +0800 Subject: [PATCH 4/8] update README --- README-zh.md | 4 +++- README.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index b1165c5..bae34f5 100755 --- a/README-zh.md +++ b/README-zh.md @@ -20,12 +20,14 @@ macOS 的 DPI 机制和 Windows 下不一样,比如 1080p 的屏幕在 Windows ## 使用方法 -在终端输入以下命令回车即可 +1.远程模式: 在终端输入以下命令回车即可 ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)" ``` +2.本地模式: 下载项目解压,把 `hidpi.sh` 拖进终端按回车运行 + ![运行](./img/run-zh.jpg) ## 恢复 diff --git a/README.md b/README.md index b9cace1..722aad9 100755 --- a/README.md +++ b/README.md @@ -18,12 +18,14 @@ System Preferences ## Usage -Run this script in Terminal +1.Remote Mode: Run this script in Terminal ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)" ``` +2.Local Mode: Download ZIP, decompressing it, drag the `hidpi.sh` file into the terminal and press Enter to run + ![RUN](./img/run.jpg) ## Recovery From 2459268e7b5d9a01aab3b29ff937cb59c8cac427 Mon Sep 17 00:00:00 2001 From: hjmmc Date: Fri, 17 Apr 2020 17:58:39 +0800 Subject: [PATCH 5/8] add hidpi.command --- README-zh.md | 2 +- README.md | 2 +- hidpi.command | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 hidpi.command diff --git a/README-zh.md b/README-zh.md index bae34f5..b465d73 100755 --- a/README-zh.md +++ b/README-zh.md @@ -26,7 +26,7 @@ macOS 的 DPI 机制和 Windows 下不一样,比如 1080p 的屏幕在 Windows bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)" ``` -2.本地模式: 下载项目解压,把 `hidpi.sh` 拖进终端按回车运行 +2.本地模式: 下载项目解压,双击 `hidpi.command` 运行 ![运行](./img/run-zh.jpg) diff --git a/README.md b/README.md index 722aad9..42dba2b 100755 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ System Preferences bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)" ``` -2.Local Mode: Download ZIP, decompressing it, drag the `hidpi.sh` file into the terminal and press Enter to run +2.Local Mode: Download ZIP, decompressing it, and double click `hidpi.command` to run ![RUN](./img/run.jpg) diff --git a/hidpi.command b/hidpi.command new file mode 100755 index 0000000..1607b88 --- /dev/null +++ b/hidpi.command @@ -0,0 +1,6 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +$DIR/hidpi.sh + From 9f01ee0d731e99122e17d615cac105874764f81a Mon Sep 17 00:00:00 2001 From: "Bat.bat" <45396585+williambj1@users.noreply.github.com> Date: Mon, 6 Jul 2020 14:04:45 +0800 Subject: [PATCH 6/8] Support macOS Big Sur --- hidpi.sh | 71 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index f08eeef..e7ac2a8 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -92,7 +92,8 @@ else exit 0 fi -if [[ "${systemVersion}" -ge "15" ]]; then +# Starting from macOS Big Sur (16), this method no longer works +if [[ "${systemVersion}" == "15" ]]; then sudo mount -uw / && killall Finder fi @@ -184,26 +185,41 @@ EEF get_edid thisDir=$(dirname $0) - thatDir="/System/Library/Displays/Contents/Resources/Overrides" - Overrides="\/System\/Library\/Displays\/Contents\/Resources\/Overrides" - - DICON="com\.apple\.cinema-display" - imacicon=${Overrides}"\/DisplayVendorID\-610\/DisplayProductID\-a032\.tiff" - mbpicon=${Overrides}"\/DisplayVendorID\-610\/DisplayProductID\-a030\-e1e1df\.tiff" - mbicon=${Overrides}"\/DisplayVendorID\-610\/DisplayProductID\-a028\-9d9da0\.tiff" - lgicon=${Overrides}"\/DisplayVendorID\-1e6d\/DisplayProductID\-5b11\.tiff" - proxdricon=${Overrides}"\/DisplayVendorID\-610\/DisplayProductID\-ae2f\_Landscape\.tiff" - - if [[ ! -d ${thatDir}/HIDPI/backup ]]; then - echo "${langBackingUp}" - sudo mkdir -p ${thatDir}/HIDPI/backup - sudo cp ${thatDir}/Icons.plist ${thatDir}/HIDPI/backup/ - if [[ -d ${thatDir}/DisplayVendorID-${Vid} ]]; then - sudo cp -r ${thatDir}/DisplayVendorID-${Vid} ${thatDir}/HIDPI/backup/ - fi + libDisplaysDir="/Library/Displays" + thatDir="${libDisplaysDir}/Contents/Resources/Overrides" + thatSysDir="/System${thatDir}" + Overrides="\/Library\/Displays\/Contents\/Resources\/Overrides" + sysOverrides="\/System${Overrides}" + if [[ "${systemVersion}" -le "15" ]]; then + thatDir=${thatSysDir} + Overrides=${sysOverrides} fi - generate_restore_cmd + DICON="com\.apple\.cinema-display" + imacicon=${sysOverrides}"\/DisplayVendorID\-610\/DisplayProductID\-a032\.tiff" + mbpicon=${sysOverrides}"\/DisplayVendorID\-610\/DisplayProductID\-a030\-e1e1df\.tiff" + mbicon=${sysOverrides}"\/DisplayVendorID\-610\/DisplayProductID\-a028\-9d9da0\.tiff" + lgicon=${sysOverrides}"\/DisplayVendorID\-1e6d\/DisplayProductID\-5b11\.tiff" + proxdricon=${Overrides}"\/DisplayVendorID\-610\/DisplayProductID\-ae2f\_Landscape\.tiff" + + if [[ ! -d ${thatDir} && "${systemVersion}" -ge "16" ]]; then + sudo mkdir -p ${thatDir} + fi + + # In Big Sur+ files are created in a seperate dir, not necessary to backup + if [[ "${systemVersion}" -le "15" ]]; then + if [[ ! -d ${thatDir}/HIDPI/backup ]]; then + echo "${langBackingUp}" + sudo mkdir -p ${thatDir}/HIDPI/backup + sudo cp ${thatSysDir}/Icons.plist ${thatDir}/HIDPI/backup/ + + if [[ -d ${thatSysDir}/DisplayVendorID-${Vid} ]]; then + sudo cp -r ${thatSysDir}/DisplayVendorID-${Vid} ${thatDir}/HIDPI/backup/ + fi + fi + + generate_restore_cmd + fi } # @@ -312,7 +328,7 @@ case ${logo} in ;; 4) Picon=${lgicon} RP=("11" "47" "202" "114") - cp ${thatDir}/DisplayVendorID-1e6d/DisplayProductID-5b11.icns ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns + cp ${thatSysDir}/DisplayVendorID-1e6d/DisplayProductID-5b11.icns ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns ;; 5) Picon=${proxdricon} RP=("5" "45" "216" "121") @@ -549,13 +565,18 @@ function enable_hidpi_with_patch() # disable function disable() { - if [[ -d ${thatDir}/DisplayVendorID-${Vid} ]]; then - sudo rm -rf ${thatDir}/DisplayVendorID-${Vid} + if [[ -d ${thatDir} && "${systemVersion}" -ge "16" ]]; then + sudo rm -rf ${libDisplaysDir} + else + if [[ -d ${thatDir}/DisplayVendorID-${Vid} ]]; then + sudo rm -rf ${thatDir}/DisplayVendorID-${Vid} + fi + + sudo rm -rf ${thatDir}/Icons.plist + sudo cp -r ${thatDir}/HIDPI/backup/* ${thatDir}/ + sudo rm -rf ${thatDir}/HIDPI/disable fi - sudo rm -rf ${thatDir}/Icons.plist - sudo cp -r ${thatDir}/HIDPI/backup/* ${thatDir}/ - sudo rm -rf ${thatDir}/HIDPI/disable echo "${langDisabled}" } From 80f139936f333ae7d93dbc05f98a2cbade5b2595 Mon Sep 17 00:00:00 2001 From: "Bat.bat" <45396585+williambj1@users.noreply.github.com> Date: Mon, 6 Jul 2020 16:56:41 +0800 Subject: [PATCH 7/8] Fix disable function for macOS Big Sur --- hidpi.sh | 115 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 82 insertions(+), 33 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index e7ac2a8..1f17af2 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -29,6 +29,9 @@ langEnableOp1="(1) Enable HIDPI" langEnableOp2="(2) Enable HIDPI (with EDID)" langEnableOp3="(3) Disable HIDPI" +langDisableOpt1="(1) Disable HIDPI on this monitor" +langDisableOpt2="(2) Reset all settings to macOS default" + langChooseRes="resolution config" langChooseResOp1="(1) 1920x1080 Display" langChooseResOp2="(2) 1920x1080 Display (use 1424x802, fix underscaled after sleep)" @@ -63,6 +66,9 @@ if [[ "${systemLanguage}" == "zh_CN" ]]; then langEnableOp2="(2) 开启HIDPI(同时注入EDID)" langEnableOp3="(3) 关闭HIDPI" + langDisableOpt1="(1) 在此显示器上禁用 HIDPI" + langDisableOpt2="(2) 还原所有设置至 macOS 默认" + langChooseRes="选择分辨率配置" langChooseResOp1="(1) 1920x1080 显示屏" langChooseResOp2="(2) 1920x1080 显示屏 (使用 1424x802 分辨率,修复睡眠唤醒后的屏幕缩小问题)" @@ -89,7 +95,7 @@ if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{pri : else echo "${disableSIP}"; - exit 0 + exit 1 fi # Starting from macOS Big Sur (16), this method no longer works @@ -142,7 +148,7 @@ function get_edid() # Lower selection (arrays start at zero). if ((selection < 1 || selection > index)); then echo "${langEnterError}"; - exit 0 + exit 1 fi let selection-=1 gMonitor=${gDisplayInf[$selection]} @@ -150,7 +156,7 @@ function get_edid() * ) echo "${langEnterError}"; - exit 0 + exit 1 ;; esac else @@ -207,19 +213,18 @@ EEF fi # In Big Sur+ files are created in a seperate dir, not necessary to backup - if [[ "${systemVersion}" -le "15" ]]; then - if [[ ! -d ${thatDir}/HIDPI/backup ]]; then - echo "${langBackingUp}" - sudo mkdir -p ${thatDir}/HIDPI/backup - sudo cp ${thatSysDir}/Icons.plist ${thatDir}/HIDPI/backup/ + sudo mkdir -p ${thatDir}/HIDPI + if [[ ! -d ${thatDir}/HIDPI/backup && "${systemVersion}" -le "15" ]]; then + echo "${langBackingUp}" + sudo mkdir -p ${thatDir}/HIDPI/backup + sudo cp ${thatSysDir}/Icons.plist ${thatDir}/HIDPI/backup/ - if [[ -d ${thatSysDir}/DisplayVendorID-${Vid} ]]; then - sudo cp -r ${thatSysDir}/DisplayVendorID-${Vid} ${thatDir}/HIDPI/backup/ - fi + if [[ -d ${thatSysDir}/DisplayVendorID-${Vid} ]]; then + sudo cp -r ${thatSysDir}/DisplayVendorID-${Vid} ${thatDir}/HIDPI/backup/ fi - - generate_restore_cmd fi + + generate_restore_cmd } # @@ -231,6 +236,8 @@ mkdir -p ${thisDir}/tmp/ cat > "${thisDir}/tmp/disable" <<-\CCC #!/bin/sh +systemVersion=($(sw_vers -productVersion | cut -d "." -f 2)) + function get_edid() { local index=0 @@ -252,14 +259,14 @@ function get_edid() [[:digit:]]* ) if ((selection < 1 || selection > index)); then echo "Enter error, bye"; - exit 0 + exit 1 fi let selection-=1 gMonitor=${gDisplayInf[$selection]} ;; * ) echo "Enter error, bye"; - exit 0 + exit 1 ;; esac else @@ -275,13 +282,39 @@ function get_edid() get_edid -if [[ -d ../DisplayVendorID-${Vid} ]]; then - rm -rf ../DisplayVendorID-${Vid} +rootPath="../../../../../../.." +if [[ "${systemVersion}" -ge "16" ]]; + rootPath="../../../../../.." fi -rm -rf ../Icons.plist -cp -r ./backup/* ../ -rm -rf ./disable +echo "" +echo "${langDisableOpt1}" +echo "${langDisableOpt2}" +echo "" + +read -p "${langInputChoice} [1~2]: " input +case ${input} in + 1) ${rootPath}/usr/libexec/plistbuddy -c "Delete :vendors:${Vid}:products:${Pid}" ../Icons.plist + ;; + 2) if [[ "${systemVersion}" -ge "16" ]]; then + rm -rf ${rootPath}/Library/Displays + else + if [[ -d ../DisplayVendorID-${Vid} ]]; then + rm -rf ../DisplayVendorID-${Vid} + fi + + rm -rf ../Icons.plist + cp -r ./backup/* ../ + rm -rf ../HIDPI + fi + ;; + *) + + echo "Enter error, bye"; + exit 1 + ;; +esac + echo "HIDPI Disabled" CCC @@ -343,7 +376,7 @@ case ${logo} in *) echo "${langEnterError}"; - exit 0 + exit 1 ;; esac @@ -431,7 +464,7 @@ case ${res} in ;; *) echo "${langEnterError}"; - exit 0 + exit 1 ;; esac @@ -565,17 +598,33 @@ function enable_hidpi_with_patch() # disable function disable() { - if [[ -d ${thatDir} && "${systemVersion}" -ge "16" ]]; then - sudo rm -rf ${libDisplaysDir} - else - if [[ -d ${thatDir}/DisplayVendorID-${Vid} ]]; then - sudo rm -rf ${thatDir}/DisplayVendorID-${Vid} - fi + echo "" + echo "${langDisableOpt1}" + echo "${langDisableOpt2}" + echo "" - sudo rm -rf ${thatDir}/Icons.plist - sudo cp -r ${thatDir}/HIDPI/backup/* ${thatDir}/ - sudo rm -rf ${thatDir}/HIDPI/disable - fi + read -p "${langInputChoice} [1~2]: " input + case ${input} in + 1) sudo /usr/libexec/plistbuddy -c "Delete :vendors:${Vid}:products:${Pid}" ${thatDir}/Icons.plist + ;; + 2) if [[ "${systemVersion}" -ge "16" ]]; then + sudo rm -rf ${libDisplaysDir} + else + if [[ -d ${thatDir}/DisplayVendorID-${Vid} ]]; then + sudo rm -rf ${thatDir}/DisplayVendorID-${Vid} + fi + + sudo rm -rf ${thatDir}/Icons.plist + sudo cp -r ${thatDir}/HIDPI/backup/* ${thatDir}/ + sudo rm -rf ${thatDir}/HIDPI + fi + ;; + *) + + echo "${langEnterError}"; + exit 1 + ;; + esac echo "${langDisabled}" } @@ -602,7 +651,7 @@ case ${input} in *) echo "${langEnterError}"; - exit 0 + exit 1 ;; esac } From 801d4e210ec55d2f1f65c5e02fc27acb43fbf1ee Mon Sep 17 00:00:00 2001 From: "Bat.bat" <45396585+williambj1@users.noreply.github.com> Date: Mon, 6 Jul 2020 17:39:03 +0800 Subject: [PATCH 8/8] /Library method works on every macOS version --- hidpi.sh | 62 ++++++++------------------------------------------------ 1 file changed, 8 insertions(+), 54 deletions(-) diff --git a/hidpi.sh b/hidpi.sh index 1f17af2..0d1fb04 100755 --- a/hidpi.sh +++ b/hidpi.sh @@ -98,11 +98,6 @@ else exit 1 fi -# Starting from macOS Big Sur (16), this method no longer works -if [[ "${systemVersion}" == "15" ]]; then - sudo mount -uw / && killall Finder -fi - function get_edid() { local index=0 @@ -196,10 +191,6 @@ EEF thatSysDir="/System${thatDir}" Overrides="\/Library\/Displays\/Contents\/Resources\/Overrides" sysOverrides="\/System${Overrides}" - if [[ "${systemVersion}" -le "15" ]]; then - thatDir=${thatSysDir} - Overrides=${sysOverrides} - fi DICON="com\.apple\.cinema-display" imacicon=${sysOverrides}"\/DisplayVendorID\-610\/DisplayProductID\-a032\.tiff" @@ -208,20 +199,8 @@ EEF lgicon=${sysOverrides}"\/DisplayVendorID\-1e6d\/DisplayProductID\-5b11\.tiff" proxdricon=${Overrides}"\/DisplayVendorID\-610\/DisplayProductID\-ae2f\_Landscape\.tiff" - if [[ ! -d ${thatDir} && "${systemVersion}" -ge "16" ]]; then - sudo mkdir -p ${thatDir} - fi - - # In Big Sur+ files are created in a seperate dir, not necessary to backup - sudo mkdir -p ${thatDir}/HIDPI - if [[ ! -d ${thatDir}/HIDPI/backup && "${systemVersion}" -le "15" ]]; then - echo "${langBackingUp}" - sudo mkdir -p ${thatDir}/HIDPI/backup - sudo cp ${thatSysDir}/Icons.plist ${thatDir}/HIDPI/backup/ - - if [[ -d ${thatSysDir}/DisplayVendorID-${Vid} ]]; then - sudo cp -r ${thatSysDir}/DisplayVendorID-${Vid} ${thatDir}/HIDPI/backup/ - fi + if [[ ! -d ${thatDir}/HIDPI ]]; then + sudo mkdir -p ${thatDir}/HIDPI fi generate_restore_cmd @@ -236,8 +215,6 @@ mkdir -p ${thisDir}/tmp/ cat > "${thisDir}/tmp/disable" <<-\CCC #!/bin/sh -systemVersion=($(sw_vers -productVersion | cut -d "." -f 2)) - function get_edid() { local index=0 @@ -282,31 +259,18 @@ function get_edid() get_edid -rootPath="../../../../../../.." -if [[ "${systemVersion}" -ge "16" ]]; - rootPath="../../../../../.." -fi +rootPath="../../../../../.." echo "" -echo "${langDisableOpt1}" -echo "${langDisableOpt2}" +echo "(1) Disable HIDPI on this monitor" +echo "(2) Reset all settings to macOS default" echo "" -read -p "${langInputChoice} [1~2]: " input +read -p "Enter your choice [1~2]: " input case ${input} in 1) ${rootPath}/usr/libexec/plistbuddy -c "Delete :vendors:${Vid}:products:${Pid}" ../Icons.plist ;; - 2) if [[ "${systemVersion}" -ge "16" ]]; then - rm -rf ${rootPath}/Library/Displays - else - if [[ -d ../DisplayVendorID-${Vid} ]]; then - rm -rf ../DisplayVendorID-${Vid} - fi - - rm -rf ../Icons.plist - cp -r ./backup/* ../ - rm -rf ../HIDPI - fi + 2) rm -rf ${rootPath}/Library/Displays ;; *) @@ -607,17 +571,7 @@ function disable() case ${input} in 1) sudo /usr/libexec/plistbuddy -c "Delete :vendors:${Vid}:products:${Pid}" ${thatDir}/Icons.plist ;; - 2) if [[ "${systemVersion}" -ge "16" ]]; then - sudo rm -rf ${libDisplaysDir} - else - if [[ -d ${thatDir}/DisplayVendorID-${Vid} ]]; then - sudo rm -rf ${thatDir}/DisplayVendorID-${Vid} - fi - - sudo rm -rf ${thatDir}/Icons.plist - sudo cp -r ${thatDir}/HIDPI/backup/* ${thatDir}/ - sudo rm -rf ${thatDir}/HIDPI - fi + 2) sudo rm -rf ${libDisplaysDir} ;; *)