Jump to content

[Example]Enable HiDPI (on Laptop)


1 post in this topic

Recommended Posts

Original Resolutions list (No HiDPI):
1366x768
1344x756
1280x720
 

Enable HiDPI:

sudo rm -rf /Library/Preferences/com.apple.windowserver.plist
sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true

 

Manually Modify Resolutions

 

# Resolutions
scale-resolutions:

2732x1536 (1366x768 double)
00000AAC 00000600 00000001 

2688x1512 (1344x756 double)
00000A80 000005E8 00000001 

2560x1440 (1280x720 double)
00000A00 000005A0 00000001 

1366x768 HiDPI
00000AAC 00000600 00000009 00A00000 

1344x756 HiDPI
00000A80 000005E8 00000009 00A00000 

1280x720 HiDPI
00000A00 000005A0 00000009 00A00000 

 

# LCD 16:9 aspect ratio
target-default-ppmm:
10.0699301000000000
 

Shell Script:

######################################
### Display Inject
######################################
## DisplayProductID    0x15be   5566
## DisplayVendorID     0xdae    3502
## DisplayProductName  CMN N156BGE-E31
## Displays Path
## OSX 10.10
## /System/Library/Displays/Overrides/
## OSX 10.11+
## /System/Library/Displays/Contents/Resources/Overrides/

# Enable HiDPI
sudo rm -rf /Library/Preferences/com.apple.windowserver.plist
sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true

PRODUCT_NAME="Color LCD"
VENDOR_DEC=$(ioreg -lw0 | grep DisplayVendorID | sed 's/.*= //g')
PRODUCT_DEC=$(ioreg -lw0 | grep DisplayProductID | sed 's/.*= //g')
VENDOR=$(printf "%x\n" $VENDOR_DEC)
PRODUCT=$(printf "%x\n" $PRODUCT_DEC)

if [ -d "/System/Library/Displays/Contents/Resources/Overrides" ]; then
    DISPLAYS_PATH=/System/Library/Displays/Contents/Resources/Overrides
else
    DISPLAYS_PATH=/System/Library/Displays/Overrides
fi

sudo mkdir -p $DISPLAYS_PATH/DisplayVendorID-$VENDOR

cat > DisplayProductID-$PRODUCT << EOF
<?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>$PRODUCT_DEC</integer>
    <key>DisplayVendorID</key>
    <integer>$VENDOR_DEC</integer>
    <key>DisplayProductName</key>
    <string>$PRODUCT_NAME</string>
    <key>scale-resolutions</key>
    <array>
        <data>AAAKrAAABgAAAAAB</data>
        <data>AAAKgAAABegAAAAB</data>
        <data>AAAKAAAABaAAAAAB</data>
        <data>AAAKrAAABgAAAAAJAKAAAA==</data>
        <data>AAAKgAAABegAAAAJAKAAAA==</data>
        <data>AAAKAAAABaAAAAAJAKAAAA==</data>
    </array>
    <key>target-default-ppmm</key>
    <real>10.0699301</real>
</dict>
</plist>
EOF

sudo mv DisplayProductID-$PRODUCT $DISPLAYS_PATH/DisplayVendorID-$VENDOR/

 

FZ3KQwl.jpg

Edited by Meowthra
×
×
  • Create New...