MBP External Display

Дешевые мониторы после patch-edid.rb — сбрасывают разрешение, и вы не можете выбрать большее разрешение для своего MAC.

Вот fix для внешнего дисплея.

#!/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

#
# Update 2016-01-17: Removing YCrCb support from extension block instead of the hole block
#                    Setting the ProductName to Dell U2515H (HiDPI+)
#                    Added scale-resolutions
#                    Command line argument for edid.hex (use DarwinDumper to get own)
# see http://www.insanelymac.com/forum/topic/310345-qhd-monitor-1920x1080-hidpi/#entry2207446


# Usage: Open Terminal and enter "ruby patch-edid.rb" or "ruby patch-edid.rb /path/to/edid.hex"
# This should give you an override file for your display.

require 'base64'

data=`ioreg -l -w0 -d0 -r -c AppleDisplay`
productname="Dell U2515H (HiDPI+)"

# command line arguments
if ARGV.length > 0
    puts "Reading hex file from arguments."
    edid_hex=File.read(ARGV[0])
else
    edid_hex=data.match(/IODisplayEDID.*?<([a-z0-9]+)>/i)[1]
end

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 "Number of extension blocks: #{bytes[126]}"
puts "Removing YCrCb support from extension block"
bytes[131] &= ~(1 << 5);
bytes[131] &= ~(1 << 4);

bytes[255] = (0x100-(bytes[128..254].reduce(:+) % 256)) % 256 ## Checksum. Sum of all 128 bytes should equal 0 (mod 256).
puts 
puts "Recalculated checksum: 0x%x" % bytes[255]
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>#{productname}</string>
  <key>IODisplayEDID</key>
  <data>#{Base64.encode64(bytes.pack('C*'))}</data>
  <key>DisplayVendorID</key>
  <integer>#{vendorid}</integer>
  <key>DisplayProductID</key>
  <integer>#{productid}</integer>
  <key>scale-resolutions</key>
  <array>
    <data>AAAPAAAACHAAAAAB</data> <!-- 3840x2160 to get 1920x1080 HiDPI -->
    <data>AAAMgAAABwgAAAAB</data> <!-- 3200x1800 to get 1600x900 HiDPI -->
    <data>AAALQAAABlQAAAAB</data> <!-- 2880x1620 to get 1440x810 HiDPI -->
  </array>
</dict>
</plist>"
f.close

На базе:

https://www.insanelymac.com/forum/topic/310345-qhd-monitor-1920×1080-hidpi/

https://codeclou.github.io/Display-Override-PropertyList-File-Parser-and-Generator-with-HiDPI-Support-For-Scaled-Resolutions/

https://gist.github.com/adaugherity/7435890

https://www.macrumors.com/how-to/disable-font-smoothing-in-macos-big-sur/

Запись опубликована в рубрике Без рубрики. Добавьте в закладки постоянную ссылку.

Добавить комментарий