Skip to content

Instantly share code, notes, and snippets.

@du-song
du-song / patch-edid.rb
Last active February 4, 2022 05:48 — forked from adaugherity/patch-edid.rb
Patch EDID to force RGB instead of YCbCr. Modified original script to add support for 1 extension block, works on MBP 2014 + macOS 11.6 + Dell S2722QC
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
# Uncrustify 0.59
#
# General options
#
# The type of line endings
newlines = auto # auto/lf/crlf/cr
# The original size of tabs in the input