How can I set the display settings using command line
I would like to configure the 'Scaled' property of my Macbook Pro display using the command line. How could I do that?
Note: This answer is obsolete.
I have an early 2013 MacBook Pro with Retina Display running OS X 10.8.5 and I've tested cscreen command line utility and it works to change resolution via the command line. You can download the cscreenIntel.dmg from the link provided. In a terminal use cscreen -h
to output the internal help information. An example of use: cscreen -d 32 -x 1680 -y 1050
BTW As far as I know Intel based versions of OS X do not include a native executable and why I'm pointing you to a third-party utility.
Use screenresolution on newer os versions
git clone https://github.com/jhford/screenresolution.git
cd screenresolution
make dmg
./screenresolution set 1920x1080x32@60
csreen did not do any thing for me on os x 10.10.5. These steps worked for me.
To set multi-display resolutions, rotations, mirroring, and positioning via terminal use displayplacer.
Execute displayplacer list
to view the possible resolutions for your screen. You'll want to use the ones marked as scaling:on
Then, execute a command similar to this to set the config displayplacer "id:A46D2F5E-487B-CC69-C588-ECFD519016E5 res:1920x1080 scaling:on origin:(0,0) degree:0"
Also available via Homebrew: brew tap jakehilborn/jakehilborn && brew install displayplacer
See RDM, which can be installed with:
brew cask install avibrazil-rdm
It's not well documented, but the same executable which launches the GUI can also be used via the command line, so after installing you can run...
/Applications/RDM.app/Contents/MacOS/SetResX --modes
...will list all available options, including a "scale" factor for Retina/HiDPI modes. You can then set your desired mode e.g...
/Applications/RDM.app/Contents/MacOS/SetResX -w 1680 -h 1050 -s 2.0
If you execute the binary via command line without an argument it will list all command line options and then start the GUI. Or you an take a look at the source directly to see them: https://github.com/avibrazil/RDM/blob/master/main.mm