Added EFI files and Utilities

This commit is contained in:
racka98
2020-10-18 17:28:46 +03:00
parent bd9e4ca11d
commit 0a42093968
189 changed files with 26454 additions and 0 deletions
Binary file not shown.
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19F101</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>AirportBrcmFixup</string>
<key>CFBundleIdentifier</key>
<string>as.lvs1974.AirportBrcmFixup</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AirportBrcmFixup</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2.1.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11E708</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19G68</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1160</string>
<key>DTXcodeBuild</key>
<string>11E708</string>
<key>IOKitPersonalities</key>
<dict>
<key>as.lvs1974.AirportBrcmFixup</key>
<dict>
<key>CFBundleIdentifier</key>
<string>as.lvs1974.AirportBrcmFixup</string>
<key>IOClass</key>
<string>AirportBrcmFixup</string>
<key>IOMatchCategory</key>
<string>AirportBrcmFixup</string>
<key>IOProviderClass</key>
<string>IOResources</string>
<key>IOResourceMatch</key>
<string>IOKit</string>
</dict>
<key>as.lvs1974.FakeAirportBrcmFixup</key>
<dict>
<key>CFBundleIdentifier</key>
<string>as.lvs1974.AirportBrcmFixup</string>
<key>IOClass</key>
<string>FakeBrcm</string>
<key>IOMatchCategory</key>
<string>IODefaultMatchCategory</string>
<key>IONameMatch</key>
<array>
<string>pci14e4,43ba</string>
<string>pci14e4,43a3</string>
<string>pci14e4,43a0</string>
<string>pci14e4,4331</string>
<string>pci14e4,4353</string>
<string>pci14e4,43b1</string>
<string>pci14e4,43b2</string>
<string>pci14e4,4357</string>
<string>pci14e4,432b</string>
<string>pci14e4,4311</string>
<string>pci14e4,4312</string>
<string>pci14e4,4313</string>
<string>pci14e4,4318</string>
<string>pci14e4,4319</string>
<string>pci14e4,431a</string>
<string>pci14e4,4320</string>
<string>pci14e4,4324</string>
<string>pci14e4,4325</string>
<string>pci14e4,4328</string>
<string>pci14e4,432c</string>
<string>pci14e4,432d</string>
</array>
<key>IOProbeScore</key>
<integer>6000</integer>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>
<key>TruePowerOff</key>
<true/>
</dict>
</dict>
<key>LSMinimumSystemVersion</key>
<string>10.8</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 lvs1974. All rights reserved.</string>
<key>OSBundleCompatibleVersion</key>
<string>1.0</string>
<key>OSBundleLibraries</key>
<dict>
<key>as.vit9696.Lilu</key>
<string>1.2.6</string>
<key>com.apple.iokit.IOPCIFamily</key>
<string>2.7</string>
<key>com.apple.kpi.bsd</key>
<string>12.0.0</string>
<key>com.apple.kpi.dsep</key>
<string>12.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>12.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>12.0.0</string>
<key>com.apple.kpi.mach</key>
<string>12.0.0</string>
<key>com.apple.kpi.unsupported</key>
<string>12.0.0</string>
</dict>
<key>OSBundleRequired</key>
<string>Network-Root</string>
</dict>
</plist>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>Copyright © 2020 lvs1974. All rights reserved.</string>
<key>CFBundleIdentifier</key>
<string>as.lvs1974.AirportBrcm4360Injector</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AirPortBrcm4360</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>IOKitPersonalities</key>
<dict>
<key>Airport_Brcm4360</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.AirPort.Brcm4360</string>
<key>IOClass</key>
<string>AirPort_Brcm4360</string>
<key>IOMatchCategory</key>
<string>IODefaultMatchCategory</string>
<key>IONameMatch</key>
<array>
<string>pci14e4,4331</string>
<string>pci14e4,4353</string>
<string>pci14e4,4357</string>
<string>pci14e4,43a3</string>
<string>pci14e4,43b1</string>
<string>pci14e4,43b2</string>
</array>
<key>IOProbeScore</key>
<integer>1110</integer>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>
<key>TruePowerOff</key>
<true/>
</dict>
</dict>
<key>OSBundleRequired</key>
<string>Network-Root</string>
</dict>
</plist>
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>Copyright © 2020 lvs1974. All rights reserved.</string>
<key>CFBundleIdentifier</key>
<string>as.lvs1974.AirportBrcmNICInjector</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AirPortBrcmNIC</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>IOKitPersonalities</key>
<dict>
<key>Airport_BrcmNIC</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.AirPort.BrcmNIC</string>
<key>IOClass</key>
<string>AirPort_BrcmNIC</string>
<key>IOMatchCategory</key>
<string>IODefaultMatchCategory</string>
<key>IONameMatch</key>
<array>
<string>pci14e4,4331</string>
<string>pci14e4,4353</string>
<string>pci14e4,4357</string>
<string>pci14e4,43ba</string>
<string>pci14e4,43a3</string>
<string>pci14e4,43a0</string>
<string>pci14e4,43b1</string>
<string>pci14e4,43b2</string>
</array>
<key>IOProbeScore</key>
<integer>2048</integer>
<key>IOProviderClass</key>
<string>IOPCIDevice</string>
<key>TruePowerOff</key>
<true/>
</dict>
</dict>
<key>OSBundleRequired</key>
<string>Network-Root</string>
</dict>
</plist>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19G73</string>
<key>CFBundleExecutable</key>
<string>BrcmFirmwareData</string>
<key>CFBundleIdentifier</key>
<string>as.acidanthera.BrcmFirmwareStore</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>BrcmFirmwareData</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>2.5.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2.5.5</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11E608c</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19E258</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1150</string>
<key>DTXcodeBuild</key>
<string>11E608c</string>
<key>IOKitPersonalities</key>
<dict>
<key>BrcmFirmwareStore</key>
<dict>
<key>CFBundleIdentifier</key>
<string>as.acidanthera.BrcmFirmwareStore</string>
<key>IOClass</key>
<string>BrcmFirmwareStore</string>
<key>IOMatchCategory</key>
<string>BrcmFirmwareStore</string>
<key>IOProviderClass</key>
<string>IOResources</string>
</dict>
</dict>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>OSBundleCompatibleVersion</key>
<string>2.5.5</string>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.iokit</key>
<string>9.0</string>
<key>com.apple.kpi.libkern</key>
<string>9.0</string>
<key>com.apple.kpi.mach</key>
<string>9.0</string>
</dict>
</dict>
</plist>
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
+4
View File
@@ -0,0 +1,4 @@
DW1820A: 00JT494 (Lenovo)
WiFi: pci14e4,43a3
bluetooth: 0a5c:6414
+18
View File
@@ -0,0 +1,18 @@
Note from i3p9:
I've updated the kexts needed to run DW1820A properly. Put all the kexts from this folder, add their entries in config.plist -> Kernel -> Add.
Then add an entry in DeviceProperties -> Add as follows:
`PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)`:
* `AAPL,slot-name` (Type String): `WLAN`
* `compatible` (Type String): `pci14e4,4331`
* `device_type` (Type String): `Airport Extreme`
* `layout-id` (Type Data 4 Bytes): `20000000` (This essentially sets `brcmfx-driver` to `2` (`AirPortBrcmNIC`)
* `model` (Type String): `DW1820A (BCM4350) 802.11ac Wireless`
* `name` (Type String): `Airport`
* `pci-aspm-default` (Type Number): `0`
Like this screenshot here:
![](https://i.imgur.com/fiLoF74.png)
Note: PciRoot location depends on your Laptop. This is specific for T450s. And the `compatible` depends on the card itself. I'm using `DW1820A 00JT494` myself.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+14
View File
@@ -0,0 +1,14 @@
# Utilities for T450s
This is where I'll store useful but optional hacks for the laptop
## alc_fix
This is a fix for Headphone jack not working after sleep. To install this, cd into the repository, then:
- `cd alc_fix`
- `chmod +x install.sh`
- `./install.sh`
## DW1820A
This folder contains instructions and kexts needed to run DW1820A which enables native WiFi/Bluetooth as well as Airdrop, Instant Hotspot, Hand-off and Continuity.
BIN
View File
Binary file not shown.
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.echo.ALCPlugFix</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ALCPlugFix</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
<key>WorkingDirectory</key>
<string>/usr/bin/</string>
</dict>
</plist>
BIN
View File
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
DAEMON_PATH=/Library/LaunchDaemons/
BIN_PATH=/usr/bin/
DAEMON_FILE=com.echo.ALCPlugFix.plist
VERB_FILE=hda-verb
FIX_FILE=ALCPlugFix
echo "Installing ALCPlugFix. Root user is required."
# check if the root filesystem is writeable (starting with macOS 10.15 Catalina, the root filesystem is read-only by default)
if sudo test ! -w "/"; then
echo "Root filesystem is not writeable. Remounting as read-write and restarting Finder."
sudo mount -uw /
sudo killall Finder
fi
# stop the daemon if it's already running
if sudo launchctl list | grep --quiet ALCPlugFix; then
echo "Stopping existing ALCPlugFix daemon."
sudo launchctl unload $DAEMON_PATH$DAEMON_FILE
fi
# copy over the files to their respective locations (overwrite automatically if files exist)
sudo cp -f ALCPlugFix $BIN_PATH
sudo cp -f hda-verb $BIN_PATH
sudo cp -f com.echo.ALCPlugFix.plist $DAEMON_PATH
# set permissions and ownership
sudo chmod 755 $BIN_PATH$FIX_FILE
sudo chown $USER:admin $BIN_PATH$FIX_FILE
sudo chmod 755 $BIN_PATH$VERB_FILE
sudo chown $USER:admin $BIN_PATH$VERB_FILE
sudo chmod 644 $DAEMON_PATH$DAEMON_FILE
sudo chown root:wheel $DAEMON_PATH$DAEMON_FILE
# load and start the daemon
sudo launchctl load -w $DAEMON_PATH$DAEMON_FILE
echo "Done!"
exit 0
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
echo "Uninstalling ALCPlugFix. Root user is required."
# check if the root filesystem is writeable (starting with macOS 10.15 Catalina, the root filesystem is read-only by default)
if sudo test ! -w "/"; then
echo "Root filesystem is not writeable. Remounting as read-write and restarting Finder."
sudo mount -uw /
sudo killall Finder
fi
sudo rm /usr/bin/ALCPlugFix
sudo rm /usr/bin/hda-verb
sudo launchctl unload -w /Library/LaunchDaemons/com.echo.ALCPlugFix.plist
sudo launchctl remove com.echo.ALCPlugFix
sudo rm /Library/LaunchDaemons/com.echo.ALCPlugFix.plist
echo "Done!"
exit 0
File diff suppressed because it is too large Load Diff
+76
View File
@@ -0,0 +1,76 @@
# 一键开启 macOS HiDPI
## 说明
[English](README.md) | [中文](README-zh.md)
 此脚本的目的是为中低分辨率的屏幕开启 HiDPI 选项,并且具有原生的 HiDPI 设置,不需要 RDM 软件即可在系统显示器设置中设置
macOS 的 DPI 机制和 Windows 下不一样,比如 1080p 的屏幕在 Windows 下有 125%、150% 这样的缩放选项,而同样的屏幕在 macOS 下,缩放选项里只是单纯的调节分辨率,这就使得在默认分辨率下字体和UI看起来很小,降低分辨率又显得模糊
同时,此脚本也可以通过注入修补后的 EDID 修复闪屏,或者睡眠唤醒后的闪屏问题,当然这个修复因人而异
开机的第二阶段 logo 总是会稍微放大,因为分辨率是仿冒的
设置:
![设置](./img/preferences.jpg)
![设置](./img/hidpi.gif)
## 使用方法
1.远程模式: 在终端输入以下命令回车即可
```bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)"
```
2.本地模式: 下载项目解压,双击 `hidpi.command` 运行
![运行](./img/run-zh.jpg)
## 恢复
### 命令恢复
如果还能进系统,就再次运行命令选择选项 3 关闭 HIDPI。
### 恢复模式
如果使用此脚本后,开机无法进入系统,请到 macos 恢复模式中或使用 clover `-x` 安全模式进入系统,打开终端
这里有两种方式进行关闭,建议选第一种
1. 快捷恢复
```bash
ls /Volumes/
cd /Volumes/你的系统盘/System/Library/Displays/Contents/Resources/Overrides/HIDPI
./disable
```
2. 手动恢复
使用终端删除 `/System/Library/Displays/Contents/Resources/Overrides` 下删除显示器 VendorID 对应的文件夹,并把 `HIDPI/backup` 文件夹中的备份复制出来。
请使用单个显示器执行以下命令,笔记本关闭外接显示器的 HIDPI 时请关闭内置显示器
具体命令如下:
```bash
ls /Volumes/
cd /Volumes/你的系统盘/System/Library/Displays/Contents/Resources/Overrides
EDID=($(ioreg -lw0 | grep -i "IODisplayEDID" | sed -e "/[^<]*</s///" -e "s/\>//"))
Vid=($(echo $EDID | cut -c18-20))
rm -rf ./DisplayVendorID-$Vid
cp -r ./HIDPI/backup/* ./
```
## 从以下得到启发
https://www.tonymacx86.com/threads/solved-black-screen-with-gtx-1070-lg-ultrafine-5k-sierra-10-12-4.219872/page-4#post-1644805
https://github.com/syscl/Enable-HiDPI-OSX
+73
View File
@@ -0,0 +1,73 @@
# Enable macOS HiDPI
## Explanation
[English](README.md) | [中文](README-zh.md)
 This script can simulate macOS HiDPI on a non-retina display, and have a "Native" Scaled in System Preferences.
Some device have wake-up issue, script's second option may help, it inject a patched EDID, but another problem may exists here.
Logo scaling up may not be resolved, cuz the higher resolution is faked.
System Preferences
![Preferences](./img/preferences.jpg)
![Preferences](./img/hidpi.gif)
## Usage
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, and double click `hidpi.command` to run
![RUN](./img/run.jpg)
## Recovery
### Normal
Still running the script in the terminal, but choose option 3
### Recovery mode
If you cant boot into system, or get any another issues, you can boot into macOS Recovery mode, and use the Terminal.app
There are two ways to close it. It is recommended to choose the first one
1.
```bash
ls /Volumes/
cd /Volumes/"Your System Disk Part"/System/Library/Displays/Contents/Resources/Overrides/HIDPI
./disable
```
2.
Remove your display's DisplayVendorID folder under `/System/Library/Displays/Contents/Resources/Overrides` , and move backup files
Please use the single display to execute the following commands. If it is a laptop, turn off the internal monitor when turning off the HIDPI of the external monitor.
In Terminal:
```bash
ls /Volumes/
cd /Volumes/"Your System Disk Part"/System/Library/Displays/Contents/Resources/Overrides
EDID=($(ioreg -lw0 | grep -i "IODisplayEDID" | sed -e "/[^<]*</s///" -e "s/\>//"))
Vid=($(echo $EDID | cut -c18-20))
rm -rf ./DisplayVendorID-$Vid
cp -r ./HIDPI/backup/* ./
```
## Inspired
https://www.tonymacx86.com/threads/solved-black-screen-with-gtx-1070-lg-ultrafine-5k-sierra-10-12-4.219872/page-4#post-1644805
https://github.com/syscl/Enable-HiDPI-OSX
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
$DIR/hidpi.sh
+589
View File
@@ -0,0 +1,589 @@
#!/bin/bash
sipInfo=("$(csrutil status)")
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"
langVendorID="VendorID"
langProductID="ProductID"
langMonitorName="MonitorName"
langChooseDis="Choose the display"
langInputChoice="Enter your choice"
langEnterError="Enter error, bye"
langBackingUp="Backing up..."
langEnabled="Enabled, please reboot."
langDisabled="Disabled, restart takes effect"
langEnabledLog="Rebooting the logo for the first time will become huge, then it will not be."
langCustomRes="Enter the HIDPI resolution, separated by a spacelike this: 1680x945 1600x900 1440x810"
langChooseIcon="Display Icon"
langNotChange="Do not change"
langEnableOp1="(1) Enable HIDPI"
langEnableOp2="(2) Enable HIDPI (with EDID)"
langEnableOp3="(3) Disable HIDPI"
langChooseRes="resolution config"
langChooseResOp1="(1) 1920x1080 Display"
langChooseResOp2="(2) 1920x1080 Display (use 1424x802, fix underscaled after sleep)"
langChooseResOp3="(3) 1920x1200 Display"
langChooseResOp4="(4) 2560x1440 Display"
langChooseResOp5="(5) 3000x2000 Display"
langChooseResOpCustom="(6) Manual input resolution"
if [[ "${systemLanguage}" == "zh_CN" ]]; then
disableSIP="需要关闭 SIP"
langRemoteMode="远程模式"
langLocalMode="本地模式"
langDisplay="显示器"
langMonitors="显示器"
langIndex="序号"
langVendorID="供应商ID"
langProductID="产品ID"
langMonitorName="显示器名称"
langChooseDis="选择显示器"
langInputChoice="输入你的选择"
langEnterError="输入错误,再见了您嘞!"
langBackingUp="正在备份(怎么还原请看说明)..."
langEnabled="开启成功,重启或重新插拔显示器生效"
langDisabled="关闭成功,重启或重新插拔显示器生效"
langEnabledLog="首次重启开机logo会变得巨大,之后就不会了"
langCustomRes="输入想要开启的 HIDPI 分辨率,用空格隔开,就像这样:1680x945 1600x900 1440x810"
langChooseIcon="选择显示器ICON"
langNotChange="保持原样"
langEnableOp1="(1) 开启HIDPI"
langEnableOp2="(2) 开启HIDPI(同时注入EDID)"
langEnableOp3="(3) 关闭HIDPI"
langChooseRes="选择分辨率配置"
langChooseResOp1="(1) 1920x1080 显示屏"
langChooseResOp2="(2) 1920x1080 显示屏 (使用 1424x802 分辨率,修复睡眠唤醒后的屏幕缩小问题)"
langChooseResOp3="(3) 1920x1200 显示屏"
langChooseResOp4="(4) 2560x1440 显示屏"
langChooseResOp5="(5) 3000x2000 显示屏"
langChooseResOpCustom="(6) 手动输入分辨率"
fi
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="$(dirname $0)"
if [ -d "${shellDir}/displayIcons" ];then
echo $langLocalMode
downloadHost="file://${shellDir}"
else
echo $langRemoteMode
fi
# if [[ "${sipInfo}" == *"Filesystem Protections: disabled"* ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled." ]] || [[ "$(awk '{print $5}' <<< "${sipInfo}")" == "disabled" ]]; then
# :
# else
# echo "${disableSIP}";
# exit 0
# fi
#
# if [[ "${systemVersion}" -ge "15" ]]; then
# sudo mount -uw / && killall Finder
# fi
function get_edid()
{
local index=0
local selection=0
gDisplayInf=($(ioreg -lw0 | grep -i "IODisplayEDID" | sed -e "/[^<]*</s///" -e "s/\>//"))
if [[ "${#gDisplayInf[@]}" -ge 2 ]]; then
# Multi monitors detected. Choose target monitor.
echo ""
echo " "${langMonitors}" "
echo "--------------------------------------------------------"
echo " "${langIndex}" | "${langVendorID}" | "${langProductID}" | "${langMonitorName}" "
echo "--------------------------------------------------------"
# Show monitors.
for display in "${gDisplayInf[@]}"
do
let index++
MonitorName=("$(echo ${display:190:24} | xxd -p -r)")
VendorID=${display:16:4}
ProductID=${gMonitor:22:2}${gMonitor:20:2}
if [[ ${VendorID} == 0610 ]]; then
MonitorName="Apple Display"
fi
if [[ ${VendorID} == 1e6d ]]; then
MonitorName="LG Display"
fi
printf " %d | ${VendorID} | ${ProductID} | ${MonitorName}\n" ${index}
done
echo "--------------------------------------------------------"
# Let user make a selection.
read -p "${langChooseDis}: " selection
case $selection in
[[:digit:]]* )
# Lower selection (arrays start at zero).
if ((selection < 1 || selection > index)); then
echo "${langEnterError}";
exit 0
fi
let selection-=1
gMonitor=${gDisplayInf[$selection]}
;;
* )
echo "${langEnterError}";
exit 0
;;
esac
else
gMonitor=${gDisplayInf}
fi
EDID=${gMonitor}
VendorID=$((0x${gMonitor:16:4}))
ProductID=$((0x${gMonitor:22:2}${gMonitor:20:2}))
Vid=($(printf '%x\n' ${VendorID}))
Pid=($(printf '%x\n' ${ProductID}))
# echo ${Vid}
# echo ${Pid}
# echo $EDID
}
# init
function init()
{
#
cat << EEF
_ _ _____ _____ _____ _____
| | | | |_ _| | __ \ | __ \ |_ _|
| |__| | | | | | | | | |__) | | |
| __ | | | | | | | | ___/ | |
| | | | _| |_ | |__| | | | _| |_
|_| |_| |_____| |_____/ |_| |_____|
============================================
EEF
#
get_edid
thisDir=$(dirname $0)
thatDir="/Library/Displays/Contents/Resources/Overrides"
Overrides="\/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
fi
generate_restore_cmd
}
#
function generate_restore_cmd()
{
#
rm -rf ${thisDir}/tmp/
mkdir -p ${thisDir}/tmp/
cat > "${thisDir}/tmp/disable" <<-\CCC
#!/bin/sh
function get_edid()
{
local index=0
local selection=0
gDisplayInf=($(ioreg -lw0 | grep -i "IODisplayEDID" | sed -e "/[^<]*</s///" -e "s/\>//"))
if [[ "${#gDisplayInf[@]}" -ge 2 ]]; then
echo ' Monitors '
echo '------------------------------------'
echo ' Index | VendorID | ProductID '
echo '------------------------------------'
for display in "${gDisplayInf[@]}"
do
let index++
printf " %d | ${display:16:4} | ${gMonitor:22:2}${gMonitor:20:2}\n" $index
done
echo '------------------------------------'
read -p "Choose the display: " selection
case $selection in
[[:digit:]]* )
if ((selection < 1 || selection > index)); then
echo "Enter error, bye";
exit 0
fi
let selection-=1
gMonitor=${gDisplayInf[$selection]}
;;
* )
echo "Enter error, bye";
exit 0
;;
esac
else
gMonitor=${gDisplayInf}
fi
EDID=$gMonitor
VendorID=$((0x${gMonitor:16:4}))
ProductID=$((0x${gMonitor:22:2}${gMonitor:20:2}))
Vid=($(printf '%x\n' ${VendorID}))
Pid=($(printf '%x\n' ${ProductID}))
}
get_edid
if [[ -d ../DisplayVendorID-${Vid} ]]; then
rm -rf ../DisplayVendorID-${Vid}
fi
rm -rf ../Icons.plist
cp -r ./backup/* ../
rm -rf ./disable
echo "HIDPI Disabled"
CCC
sudo mv ${thisDir}/tmp/disable ${thatDir}/HIDPI/
sudo chmod +x ${thatDir}/HIDPI/disable
}
# choose_icon
function choose_icon()
{
#
rm -rf ${thisDir}/tmp/
mkdir -p ${thisDir}/tmp/
mkdir -p ${thisDir}/tmp/DisplayVendorID-${Vid}
curl -fsSL "${downloadHost}/Icons.plist" -o ${thisDir}/tmp/Icons.plist
echo ""
echo "-------------------------------------"
echo "|********** ${langChooseIcon} ***********|"
echo "-------------------------------------"
echo ""
echo "(1) iMac"
echo "(2) MacBook"
echo "(3) MacBook Pro"
echo "(4) LG ${langDisplay}"
echo "(5) Pro Display XDR"
echo "(6) ${langNotChange}"
echo ""
#
read -p "${langInputChoice} [1~6]: " logo
case ${logo} in
1) Picon=${imacicon}
RP=("33" "68" "160" "90")
curl -fsSL "${downloadHost}/displayIcons/iMac.icns" -o ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns
;;
2) Picon=${mbicon}
RP=("52" "66" "122" "76")
curl -fsSL "${downloadHost}/displayIcons/MacBook.icns" -o ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns
;;
3) Picon=${mbpicon}
RP=("40" "62" "147" "92")
curl -fsSL "${downloadHost}/displayIcons/MacBookPro.icns" -o ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns
;;
4) Picon=${lgicon}
RP=("11" "47" "202" "114")
cp ${thatDir}/DisplayVendorID-1e6d/DisplayProductID-5b11.icns ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns
;;
5) Picon=${proxdricon}
RP=("5" "45" "216" "121")
curl -fsSL "${downloadHost}/displayIcons/ProDisplayXDR.icns" -o ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.icns
if [[ ! -f ${thatDir}/DisplayVendorID-610/DisplayProductID-ae2f_Landscape.tiff ]]; then
curl -fsSL "${downloadHost}/displayIcons/ProDisplayXDR.tiff" -o ${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}.tiff
Picon=${Overrides}"\/DisplayVendorID\-${Vid}\/DisplayProductID\-${Pid}\.tiff"
fi
;;
6) rm -rf ${thisDir}/tmp/Icons.plist
;;
*)
echo "${langEnterError}";
exit 0
;;
esac
if [[ ${Picon} ]]; then
DICON=${Overrides}"\/DisplayVendorID\-${Vid}\/DisplayProductID\-${Pid}\.icns"
/usr/bin/sed -i "" "s/VID/${Vid}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/PID/${Pid}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/RPX/${RP[0]}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/RPY/${RP[1]}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/RPW/${RP[2]}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/RPH/${RP[3]}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/PICON/${Picon}/g" ${thisDir}/tmp/Icons.plist
/usr/bin/sed -i "" "s/DICON/${DICON}/g" ${thisDir}/tmp/Icons.plist
fi
}
# main
function main()
{
sudo mkdir -p ${thisDir}/tmp/DisplayVendorID-${Vid}
dpiFile=${thisDir}/tmp/DisplayVendorID-${Vid}/DisplayProductID-${Pid}
sudo chmod -R 777 ${thisDir}/tmp/
#
cat > "${dpiFile}" <<-\CCC
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DisplayProductID</key>
<integer>PID</integer>
<key>DisplayVendorID</key>
<integer>VID</integer>
<key>IODisplayEDID</key>
<data>EDid</data>
<key>scale-resolutions</key>
<array>
CCC
echo ""
echo "------------------------------------------"
echo "|********** "${langChooseRes}" ***********|"
echo "------------------------------------------"
echo ${langChooseResOp1}
echo ${langChooseResOp2}
echo ${langChooseResOp3}
echo ${langChooseResOp4}
echo ${langChooseResOp5}
echo ${langChooseResOpCustom}
echo ""
#
read -p "${langInputChoice}: " res
case ${res} in
1 ) create_res_1 1680x945 1440x810 1280x720 1024x576
create_res_2 1280x800 1280x720 960x600 960x540 640x360
create_res_3 840x472 800x450 720x405 640x360 576x324 512x288 420x234 400x225 320x180
create_res_4 1680x945 1440x810 1280x720 1024x576 960x540 840x472 800x450 640x360
;;
2 ) create_res_1 1680x945 1424x802 1280x720 1024x576
create_res_2 1280x800 1280x720 960x600 960x540 640x360
create_res_3 840x472 800x450 720x405 640x360 576x324 512x288 420x234 400x225 320x180
create_res_4 1680x945 1440x810 1280x720 1024x576 960x540 840x472 800x450 640x360
;;
3 ) create_res_1 1680x1050 1440x900 1280x800 1024x640
create_res_2 1280x800 1280x720 960x600 960x540 640x360
create_res_3 840x472 800x450 720x405 640x360 576x324 512x288 420x234 400x225 320x180
create_res_4 1680x1050 1440x900 1280x800 1024x640 960x540 840x472 800x450 640x360
;;
4 ) create_res_1 2560x1440 2048x1152 1920x1080 1760x990 1680x945 1440x810 1360x765 1280x720
create_res_2 1360x765 1280x800 1280x720 1024x576 960x600 960x540 640x360
create_res_3 960x540 840x472 800x450 720x405 640x360 576x324 512x288 420x234 400x225 320x180
create_res_4 2048x1152 1920x1080 1680x945 1440x810 1280x720 1024x576 960x540 840x472 800x450 640x360
;;
5 ) create_res_1 3000x2000 2880x1920 2250x1500 1920x1280 1680x1050 1440x900 1280x800 1024x640
create_res_2 1280x800 1280x720 960x600 960x540 640x360
create_res_3 840x472 800x450 720x405 640x360 576x324 512x288 420x234 400x225 320x180
create_res_4 1920x1280 1680x1050 1440x900 1280x800 1024x640 960x540 840x472 800x450 640x360
;;
6 ) custom_res
create_res_2 1360x765 1280x800 1280x720 960x600 960x540 640x360
create_res_3 840x472 800x450 720x405 640x360 576x324 512x288 420x234 400x225 320x180
create_res_4 1680x945 1440x810 1280x720 1024x576 960x540 840x472 800x450 640x360
;;
*)
echo "${langEnterError}";
exit 0
;;
esac
cat >> "${dpiFile}" <<-\FFF
</array>
<key>target-default-ppmm</key>
<real>10.0699301</real>
</dict>
</plist>
FFF
/usr/bin/sed -i "" "s/VID/$VendorID/g" ${dpiFile}
/usr/bin/sed -i "" "s/PID/$ProductID/g" ${dpiFile}
}
# end
function end()
{
sudo chown -R root:wheel ${thisDir}/tmp/
sudo chmod -R 0755 ${thisDir}/tmp/
sudo chmod 0644 ${thisDir}/tmp/DisplayVendorID-${Vid}/*
sudo cp -r ${thisDir}/tmp/* ${thatDir}/
sudo rm -rf ${thisDir}/tmp
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES
echo "${langEnabled}"
echo "${langEnabledLog}"
}
# custom resolution
function custom_res()
{
echo "${langCustomRes}"
read -p ":" res
create_res ${res}
}
# create resolution
function create_res()
{
for res in $@; do
width=$(echo ${res} | cut -d x -f 1)
height=$(echo ${res} | cut -d x -f 2)
hidpi=$(printf '%08x %08x' $((${width}*2)) $((${height}*2)) | xxd -r -p | base64)
#
cat << OOO >> ${dpiFile}
<data>${hidpi:0:11}AAAAB</data>
<data>${hidpi:0:11}AAAABACAAAA==</data>
OOO
done
}
function create_res_1()
{
for res in $@; do
width=$(echo ${res} | cut -d x -f 1)
height=$(echo ${res} | cut -d x -f 2)
hidpi=$(printf '%08x %08x' $((${width}*2)) $((${height}*2)) | xxd -r -p | base64)
#
cat << OOO >> ${dpiFile}
<data>${hidpi:0:11}A</data>
OOO
done
}
function create_res_2()
{
for res in $@; do
width=$(echo ${res} | cut -d x -f 1)
height=$(echo ${res} | cut -d x -f 2)
hidpi=$(printf '%08x %08x' $((${width}*2)) $((${height}*2)) | xxd -r -p | base64)
#
cat << OOO >> ${dpiFile}
<data>${hidpi:0:11}AAAABACAAAA==</data>
OOO
done
}
function create_res_3()
{
for res in $@; do
width=$(echo ${res} | cut -d x -f 1)
height=$(echo ${res} | cut -d x -f 2)
hidpi=$(printf '%08x %08x' $((${width}*2)) $((${height}*2)) | xxd -r -p | base64)
#
cat << OOO >> ${dpiFile}
<data>${hidpi:0:11}AAAAB</data>
OOO
done
}
function create_res_4()
{
for res in $@; do
width=$(echo ${res} | cut -d x -f 1)
height=$(echo ${res} | cut -d x -f 2)
hidpi=$(printf '%08x %08x' $((${width}*2)) $((${height}*2)) | xxd -r -p | base64)
#
cat << OOO >> ${dpiFile}
<data>${hidpi:0:11}AAAAJAKAAAA==</data>
OOO
done
}
# enable
function enable_hidpi()
{
choose_icon
main
sed -i "" "/.*IODisplayEDID/d" ${dpiFile}
sed -i "" "/.*EDid/d" ${dpiFile}
end
}
# patch
function enable_hidpi_with_patch()
{
choose_icon
main
version=${EDID:38:2}
basicparams=${EDID:40:2}
checksum=${EDID:254:2}
newchecksum=$(printf '%x' $((0x${checksum} + 0x${version} +0x${basicparams} - 0x04 - 0x90)) | tail -c 2)
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}
end
}
# disable
function disable()
{
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
echo "${langDisabled}"
}
#
function start()
{
init
echo ""
echo ${langEnableOp1}
echo ${langEnableOp2}
echo ${langEnableOp3}
echo ""
#
read -p "${langInputChoice} [1~3]: " input
case ${input} in
1) enable_hidpi
;;
2) enable_hidpi_with_patch
;;
3) disable
;;
*)
echo "${langEnterError}";
exit 0
;;
esac
}
start
Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB