-
-
Save krackers/4c720fa3077ba6d3ae5c0b2caea40e0f to your computer and use it in GitHub Desktop.
Revisions
-
ejdyksen revised this gist
Nov 16, 2020 . 1 changed file with 20 additions and 33 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,53 +1,40 @@ ## patch-edid.rb A script to fix EDID problems on external monitors in macOS. ### Instructions 1. Connect only the problem display. 1. Create this directory structure (if it doesn't already exist): ```shell sudo mkdir -p /Library/Displays/Contents/Resources/Overrides ``` 1. Download this ruby script in that directory: ```shell cd /Library/Displays/Contents/Resources/Overrides sudo curl -O https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb ``` *Note: You may want to use [adaugherity's version](https://gist.github.com/adaugherity/7435890) of the script instead.* 1. Run the script we just downloaded (as root again). This creates a new display override plist file. ```shell cd /Library/Displays/Contents/Resources/Overrides sudo ruby patch-edid.rb ``` 1. Unplug and replug in the problem display. ### Additional reading/acknowledgements * [The original forum thread](http://embdev.net/topic/284710) * An improved version of the script [by adaugherity](https://gist.github.com/adaugherity/7435890) * [An explaination of the problem](https://spin.atomicobject.com/2018/08/24/macbook-pro-external-monitor-display-problem/) from Atomic Object's blog * Thanks so much to @stackrainbow for [pointing out](https://gist.github.com/ejdyksen/8302862#gistcomment-3460110) that this can be done without disabling SIP. * This version appears to work in Catalina and Big Sur. See earlier revisions for what worked (with disabling SIP) in earlier versions of macOS, which require the override plist to be in a different directory. -
ejdyksen renamed this gist
Jun 18, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ejdyksen revised this gist
Jun 18, 2020 . 1 changed file with 15 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,14 @@ A script to fix EDID problems on external monitors in Mac OS. ### Additional reading * [The original forum thread](http://embdev.net/topic/284710) * An improved version of the script [by adaugherity](https://gist.github.com/adaugherity/7435890) * [An explaination of the problem](https://spin.atomicobject.com/2018/08/24/macbook-pro-external-monitor-display-problem/) from Atomic Object's blog ### Instructions ⚠️ **This requires disabling SIP, so run this at your own risk. Be sure to re-enable SIP at the end.** 1. Disable [System Integrity Protection](https://support.apple.com/en-us/HT204899) while in [Recovery Mode](https://support.apple.com/en-us/HT201314). Reboot back into macOS when done. @@ -25,6 +33,13 @@ A script to fix EDID problems on external monitors in Mac OS. sudo curl -O https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb ``` You may also want to use [adaugherity's version](https://gist.github.com/adaugherity/7435890) of the script: ``` cd /System/Library/Displays/Contents/Resources/Overrides sudo curl -O https://gist.github.com/adaugherity/7435890/raw/patch-edid.rb ``` 1. Run the script we just downloaded (as root again). This creates a new display override plist. ``` @@ -36,5 +51,3 @@ A script to fix EDID problems on external monitors in Mac OS. ``` csrutil enable ``` -
ejdyksen revised this gist
Jun 18, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ A script to fix EDID problems on external monitors in Mac OS. ⚠️ **This requires disabling SIP, so run this at your own risk. Be sure to re-enable SIP at the end.** 1. Disable [System Integrity Protection](https://support.apple.com/en-us/HT204899) while in [Recovery Mode](https://support.apple.com/en-us/HT201314). Reboot back into macOS when done. ``` csrutil disable @@ -31,7 +31,7 @@ A script to fix EDID problems on external monitors in Mac OS. sudo ruby patch-edid.rb ``` 1. Reboot into recovery mode to re-enable SIP. ``` csrutil enable -
ejdyksen renamed this gist
Jun 18, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ejdyksen revised this gist
Jun 18, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ A script to fix EDID problems on external monitors in Mac OS. ⚠️ **This requires disabling SIP, so run this at your own risk. Be sure to re-enable SIP at the end.** 1. Disable [System Integrity Protection](https://support.apple.com/en-us/HT204899) in [Recovery Mode](https://support.apple.com/en-us/HT201314). -
ejdyksen revised this gist
Jun 18, 2020 . 1 changed file with 27 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,22 +2,39 @@ A script to fix EDID problems on external monitors in Mac OS. 🚨 **Note: As this requires disabling System Integrity Protection, run this at your own risk, and be sure to re-enable SIP at the end.** 🚨 1. Disable [System Integrity Protection](https://support.apple.com/en-us/HT204899) in [Recovery Mode](https://support.apple.com/en-us/HT201314). ``` csrutil disable ``` 1. For macOS Catalina and newer (which uses a [read-only system volume](https://support.apple.com/en-us/HT210650)), mount the system drive read/write (yes, this is in addition to disabling SIP) ``` sudo mount -uw / ``` 1. Connect *only* the problem monitor 1. Download this script in the directory containing all the display override plist files (note: even with the steps above, this command requires sudo to run): ``` cd /System/Library/Displays/Contents/Resources/Overrides sudo curl -O https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb ``` 1. Run the script we just downloaded (as root again). This creates a new display override plist. ``` sudo ruby patch-edid.rb ``` 1. Reboot into recovery mode and re-enable SIP. ``` csrutil enable ``` Source: http://embdev.net/topic/284710 -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,6 @@ A script to fix EDID problems on external monitors in Mac OS. 1. Connect the problem monitor. @@ -20,4 +18,6 @@ http://embdev.net/topic/284710 sudo ruby patch-edid.rb ``` 1. Disconnect and reconnect the monitor. Source: http://embdev.net/topic/284710 -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## patch-edid.rb A script to fix EDID problems on external monitors in Mac OS. -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ A script to fix EDID problems on external monitors in Mac OS. Source: http://embdev.net/topic/284710 1. Connect the problem monitor. 1. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). @@ -20,4 +20,4 @@ http://embdev.net/topic/284710 sudo ruby patch-edid.rb ``` 1. Disconnect and reconnect the monitor. -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ ## patch-edid A script to fix EDID problems on external monitors in Mac OS. Source: http://embdev.net/topic/284710 1. Connect the problem monitor 1. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,16 @@ 1. Connect the problem monitor 1. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). ``` cd /System/Library/Displays/Overrides sudo curl -O https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb ``` 1. Run the script we just downloaded (as root again). This creates a new display override plist. ``` sudo ruby patch-edid.rb ``` 1. Disconnect and reconnect the monitor -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,10 @@ 2. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). ``` cd /System/Library/Displays/Overrides sudo wget https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb sudo ruby patch-edid.rb ``` 3. Disconnect and reconnect the monitor -
ejdyksen renamed this gist
Jan 7, 2014 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,10 +2,8 @@ 2. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). cd /System/Library/Displays/Overrides sudo wget https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb sudo ruby patch-edid.rb 3. Disconnect and reconnect the monitor -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ 1. Connect the problem monitor 2. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). ``` cd /System/Library/Displays/Overrides sudo wget https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb sudo ruby patch-edid.rb ``` 3. Disconnect and reconnect the monitor -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ 1. Connect the problem monitor 1. Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). ``` cd /System/Library/Displays/Overrides sudo wget https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb sudo ruby patch-edid.rb ``` 1. Disconnect and reconnect the monitor -
ejdyksen revised this gist
Jan 7, 2014 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ 1) Connect the problem monitor 1) Download this script into your `/System/Library/Displays/Overrides` (note: this file is only writeable by root, so some commands require `sudo`). ``` cd /System/Library/Displays/Overrides sudo wget https://gist.github.com/ejdyksen/8302862/raw/patch-edid.rb sudo ruby patch-edid.rb ``` 1) Disconnect and reconnect the monitor -
ejdyksen created this gist
Jan 7, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ #!/usr/bin/ruby # Create display override file to force Mac OS X to use RGB mode for Display # see http://embdev.net/topic/284710 # # Update 2013-06-24: added -w0 option to prevent truncated lines require 'base64' data=`ioreg -l -w0 -d0 -r -c AppleDisplay` edid_hex=data.match(/IODisplayEDID.*?<([a-z0-9]+)>/i)[1] vendorid=data.match(/DisplayVendorID.*?([0-9]+)/i)[1].to_i productid=data.match(/DisplayProductID.*?([0-9]+)/i)[1].to_i puts "found display: vendorid #{vendorid}, productid #{productid}, EDID:\n#{edid_hex}" bytes=edid_hex.scan(/../).map{|x|Integer("0x#{x}")}.flatten puts "Setting color support to RGB 4:4:4 only" bytes[24] &= ~(0b11000) puts "Number of extension blocks: #{bytes[126]}" puts "removing extension block" bytes = bytes[0..127] bytes[126] = 0 bytes[127] = (0x100-(bytes[0..126].reduce(:+) % 256)) % 256 puts puts "Recalculated checksum: 0x%x" % bytes[127] puts "new EDID:\n#{bytes.map{|b|"%02X"%b}.join}" Dir.mkdir("DisplayVendorID-%x" % vendorid) rescue nil f = File.open("DisplayVendorID-%x/DisplayProductID-%x" % [vendorid, productid], 'w') f.write '<?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">' f.write " <dict> <key>DisplayProductName</key> <string>Display with forced RGB mode (EDID override)</string> <key>IODisplayEDID</key> <data>#{Base64.encode64(bytes.pack('C*'))}</data> <key>DisplayVendorID</key> <integer>#{vendorid}</integer> <key>DisplayProductID</key> <integer>#{productid}</integer> </dict> </plist>" f.close