Script that attempts to force M1 macs into RGB mode when used with monitors that are defaulting to YPbPr.

Overview

fix_m1_rgb

Script that attempts to force M1 macs into RGB mode when used with monitors that are defaulting to YPbPr.

No warranty provided for using this script. Use at your own risk.

Instructions

Prerequisites

  1. Make sure you are on Mac OS X 11.4 or higher. Upgrade if you haven't.
  2. Open System Preferences > Displays > Rotate the monitor that's in YPbPr mode in order to force it to write to the relevant plist file. You can unrotate it immediately or allow it to auto-revert.

Running the Script

From your Terminal, run:

# Download the script
curl -o ~/Downloads/fix_m1_rgb.py https://raw.githubusercontent.com/sudowork/fix_m1_rgb/main/fix_m1_rgb.py
# Run a dry run and validate the results
python3 ~/Downloads/fix_m1_rgb.py --dry-run
# Once the results are validated, apply the changes.
# Note: You may be prompted for your password in order to backup and modify files under /Library.
python3 ~/Downloads/fix_m1_rgb.py

Restart your computer after you're done, and if all worked out well, then your monitor should be in RGB mode.

Note: The script will backup your original plist files. In addition, the script does not try to discriminate between various displays, so it will write the PixelEncoding and Range values for all displays with a LinkDescription field.

Kudos

Kudos to @GetVladimir for identifying the plist changes that need to be made.

Comments
  • Errors: PixelEncoding and Range not as expected / No LinkDescription found in display config

    Errors: PixelEncoding and Range not as expected / No LinkDescription found in display config

    On a Macbook Pro M1 running Big Sur 11.4 The dryrun is giving errors. I edited plist with a binary editor and there is definitely a LinkDescription in there so I'm not sure what's going on?

    `

    [2021-07-15 15:26:03 INFO] Found /Library/Preferences/com.apple.windowserver.displays.plist. [2021-07-15 15:26:03 INFO] Backing up file /Library/Preferences/com.apple.windowserver.displays.plist -> /Library/Preferences/com.apple.windowserver.displays.plist.bak.1626377163 [2021-07-15 15:26:03 INFO] Fixing /Library/Preferences/com.apple.windowserver.displays.plist [2021-07-15 15:26:03 INFO] Fixing config for Display 37D8832A-2D66-02CA-B9F7-8F30A301B230 [2021-07-15 15:26:03 INFO] Did not fix Display 37D8832A-2D66-02CA-B9F7-8F30A301B230. Values for PixelEncoding and Range not as expected. [2021-07-15 15:26:03 INFO] Fixing config for Display 6521F0F7-E764-6900-0857-D6964E3302DB [2021-07-15 15:26:03 INFO] Fixed Display 6521F0F7-E764-6900-0857-D6964E3302DB [2021-07-15 15:26:03 INFO] Resulting XML output for /Library/Preferences/com.apple.windowserver.displays.plist:

    ....

    [2021-07-15 15:26:03 INFO] Writing output to /Library/Preferences/com.apple.windowserver.displays.plist [2021-07-15 15:26:03 INFO] Found /Users/paulmorris/Library/Preferences/ByHost/com.apple.windowserver.displays.03D04E29-7EB8-5025-A535-ACC0370EB337.plist. [2021-07-15 15:26:03 INFO] Backing up file /Users/paulmorris/Library/Preferences/ByHost/com.apple.windowserver.displays.03D04E29-7EB8-5025-A535-ACC0370EB337.plist -> /Users/paulmorris/Library/Preferences/ByHost/com.apple.windowserver.displays.03D04E29-7EB8-5025-A535-ACC0370EB337.plist.bak.1626377163 [2021-07-15 15:26:03 INFO] Fixing /Users/paulmorris/Library/Preferences/ByHost/com.apple.windowserver.displays.03D04E29-7EB8-5025-A535-ACC0370EB337.plist [2021-07-15 15:26:03 INFO] Skipping /Users/paulmorris/Library/Preferences/ByHost/com.apple.windowserver.displays.03D04E29-7EB8-5025-A535-ACC0370EB337.plist. No LinkDescription found in display config. Try rotating your display from Display settings to generate the field in the plist.`

    opened by Paul-Morris 10
  • No `LinkDescription` found in display config. Try rotating your display from Display settings to generate the field in the plist.

    No `LinkDescription` found in display config. Try rotating your display from Display settings to generate the field in the plist.

    Thank you for your work! Unfortunately, it does not seem to work in my setting, I get a

    No LinkDescription found in display config. Try rotating your display from Display settings to generate the field in the plist.

    In my case, I'm connecting an M1 MacBook Pro via USB-C to a CableMatters USB-C to Display Port Hub to a Dell U2711 on 11.4. Tried multiple times and yes, display was rotated.

    opened by Je-Ho 4
  • Add support for macOS Monterey

    Add support for macOS Monterey

    Yes, I know it's only just been made available to developers, but at this point the script just says 'OS not supported' so I can't even try to see if it works. I actually upgraded to the beta to see if it might fix this issue once and for all. Not yet.

    opened by AmpCat 4
  • Back up and delete `com.apple.windowserver*` plist files in other directories

    Back up and delete `com.apple.windowserver*` plist files in other directories

    From my comment here, this script did not work for me until I manually deleted the display plist in ~/Library/Preferences/ByHost.

    Is this something that you feel should be added to the script?

    opened by jamescmartinez 2
  • Monterey =(

    Monterey =(

    This script worked perfectly the first time I ran it long ago.

    I upgraded to Monterey and recently verified the monitor was still RGB and it was not. I re-ran the script, restarted, and it was still in YPbPr.

    I ended up switching to a thunderbolt port on the mac and USB-C input on the monitor and now I'm back in RGB.

    opened by idontusenumbers 1
  • Error: No LinkDescription found in display config. Try rotating your display from Display settings to generate the field in the plist.

    Error: No LinkDescription found in display config. Try rotating your display from Display settings to generate the field in the plist.

    @sudowork thank you for this lovely attempt.

    Unfortunately, it seems this issue persists.

    MacOC 12.0.1 M1 Pro 14" Display DELL S2721Q

    I've rotated the monitor, run code in the terminal, restart, and the monitor stays in YPbPr, with the only RGB option showing the magenta wash as others have described.

    The script results follow, showing the same error as above:

    [USER REDACT] ~ % python3 ~/Downloads/fix_m1_rgb.py [2021-12-22 17:24:04 WARNING] This script has not fully been tested on OS X 12 Monterey. Do you want to continue? [yN] y [2021-12-22 17:24:29 INFO] Looking for preferences in: /Library/Preferences/com.apple.windowserver.displays.plist /Users/hal-9001/Library/Preferences/com.apple.windowserver.displays.plist [2021-12-22 17:24:29 INFO] Found /Library/Preferences/com.apple.windowserver.displays.plist. [2021-12-22 17:24:29 INFO] Backing up file /Library/Preferences/com.apple.windowserver.displays.plist -> /Library/Preferences/com.apple.windowserver.displays.plist.bak.1640211869 Password: /Library/Preferences/com.apple.windowserver.displays.plist -> /Library/Preferences/com.apple.windowserver.displays.plist.bak.1640211869 [2021-12-22 17:24:39 INFO] Fixing /Library/Preferences/com.apple.windowserver.displays.plist [2021-12-22 17:24:39 INFO] Skipping /Library/Preferences/com.apple.windowserver.displays.plist. No LinkDescription found in display config. Try rotating your display from Display settings to generate the field in the plist. [2021-12-22 17:24:39 INFO] Found ByHost preferences at /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist - removing [2021-12-22 17:24:39 INFO] Backing up file /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist -> /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist.bak.1640211879 /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist -> /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist.bak.1640211879 [2021-12-22 17:24:39 INFO] Removing file /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist /Users/hal-9001/Library/Preferences/ByHost/com.apple.windowserver.displays.6A723102-96D2-556B-8BBC-361AD165BF52.plist

    opened by gryphtl 1
  • [Feature] Add functionality to interactively restore from backups

    [Feature] Add functionality to interactively restore from backups

    Provide a separate command fix_m1_rgb.py restore that creates a curses-based interface for being able to explore backups and restore from them.

    • [ ] Implement separate command for restore
    • [ ] Implement curses interface
    • [ ] Show available backups
    • [ ] Implement basic navigation using curses
    • [ ] Screens
      • [ ] Select file to restore
      • [ ] Show backups for file
      • [ ] Implement display
        • [ ] Scrolling / navigation
        • [ ] Line numbers
      • [ ] Views to display
        • [ ] View XML of a backup
        • [ ] View JSON of a backup
      • [ ] Diff current version vs backup
    • [ ] Restore (first create a new backup, then restore)
    opened by sudowork 0
Owner
Kevin Gao
Kevin Gao
DSAC* for Visual Camera Re-Localization (RGB or RGB-D)

DSAC* for Visual Camera Re-Localization (RGB or RGB-D) Introduction Installation Data Structure Supported Datasets 7Scenes 12Scenes Cambridge Landmark

Visual Learning Lab 143 Dec 22, 2022
3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans.

3DMV 3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans. This work is based on our ECCV'18 p

Владислав Молодцов 0 Feb 6, 2022
Count the MACs / FLOPs of your PyTorch model.

THOP: PyTorch-OpCounter How to install pip install thop (now continously intergrated on Github actions) OR pip install --upgrade git+https://github.co

Ligeng Zhu 3.9k Dec 29, 2022
This project is for a Twitter bot that monitors a bird feeder in my backyard. Any detected birds are identified and posted to Twitter.

Backyard Birdbot Introduction This is a silly hobby project to use existing ML models to: Detect any birds sighted by a webcam Identify whic

Chi Young Moon 71 Dec 25, 2022
Detector for Log4Shell exploitation attempts

log4shell-detector Detector for Log4Shell exploitation attempts Idea The problem with the log4j CVE-2021-44228 exploitation is that the string can be

Florian Roth 729 Dec 25, 2022
A model that attempts to learn and benefit from data collected on card counting.

A model that attempts to learn and benefit from data collected on card counting. A decision tree like model is built to win more often than loose and increase the bet of the player appropriately to come out winning as much money as possible.

null 1 Dec 17, 2021
Python code to fuse multiple RGB-D images into a TSDF voxel volume.

Volumetric TSDF Fusion of RGB-D Images in Python This is a lightweight python script that fuses multiple registered color and depth images into a proj

Andy Zeng 845 Jan 3, 2023
Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20. model in ONNX

ONNX msg_chn_wacv20 depth completion Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20 model in

Ibai Gorordo 19 Oct 22, 2022
Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20. model in Tensorflow Lite.

TFLite-msg_chn_wacv20-depth-completion Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20. model

Ibai Gorordo 2 Oct 4, 2021
Custom TensorFlow2 implementations of forward and backward computation of soft-DTW algorithm in batch mode.

Batch Soft-DTW(Dynamic Time Warping) in TensorFlow2 including forward and backward computation Custom TensorFlow2 implementations of forward and backw

null 19 Aug 30, 2022
Generalized hybrid model for mode-locked laser diodes with an extended passive cavity

GenHybridMLLmodel Generalized hybrid model for mode-locked laser diodes with an extended passive cavity This hybrid simulation strategy combines a tra

Stijn Cuyvers 3 Sep 21, 2022
wlad 2 Dec 19, 2022
We will see a basic program that is basically a hint to brute force attack to crack passwords. In other words, we will make a program to Crack Any Password Using Python. Show some ❤️ by starring this repository!

Crack Any Password Using Python We will see a basic program that is basically a hint to brute force attack to crack passwords. In other words, we will

Ananya Chatterjee 11 Dec 3, 2022
VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation

VID-Fusion VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation Authors: Ziming Ding , Tiankai Yang, Kunyi Zhan

ZJU FAST Lab 86 Nov 18, 2022
EasyMocap is an open-source toolbox for markerless human motion capture from RGB videos.

EasyMocap is an open-source toolbox for markerless human motion capture from RGB videos. In this project, we provide the basic code for fitt

ZJU3DV 2.2k Jan 5, 2023
Learning RGB-D Feature Embeddings for Unseen Object Instance Segmentation

Unseen Object Clustering: Learning RGB-D Feature Embeddings for Unseen Object Instance Segmentation Introduction In this work, we propose a new method

NVIDIA Research Projects 132 Dec 13, 2022
CoReNet is a technique for joint multi-object 3D reconstruction from a single RGB image.

CoReNet CoReNet is a technique for joint multi-object 3D reconstruction from a single RGB image. It produces coherent reconstructions, where all objec

Google Research 80 Dec 25, 2022
Towards Part-Based Understanding of RGB-D Scans

Towards Part-Based Understanding of RGB-D Scans (CVPR 2021) We propose the task of part-based scene understanding of real-world 3D environments: from

null 26 Nov 23, 2022
RGB-D Local Implicit Function for Depth Completion of Transparent Objects

RGB-D Local Implicit Function for Depth Completion of Transparent Objects [Project Page] [Paper] Overview This repository maintains the official imple

NVIDIA Research Projects 43 Dec 12, 2022