macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS.
Install via Homebrew with brew install displayplacer
or visit the releases tab.
Show current screen info and possible resolutions: displayplacer list
Apply screen config (hz & color_depth are optional): displayplacer "id:<screenId> res:<width>x<height> hz:<num> color_depth:<num> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"
Apply screen config using mode: displayplacer "id:<screenId> mode:<modeNum> origin:(<x>,<y>) degree:<0/90/180/270>"
Apply screen config with mirrored screens: displayplacer "id:<mainScreenId>+<1stMirrorScreenId>+<2ndMirrorScreenId> res:<width>x<height> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"
Silence errors per-screen using quiet: displayplacer "id:<screenId> mode:<modeNum> origin:(<x>,<y>) degree:0 quiet:true"
Disable a screen: displayplacer "id:<screenId> enabled:false"
displayplacer list
to print your current layout's args, so you can create profiles for scripting/hotkeys with Automator, BetterTouchTool, etc.Unfortunately, macOS sometimes changes the persistent screenIds when there are race conditions from external screens waking up in non-determinisic order. If none of the screenId options below work for your setup, please search around in the GitHub Issues for conversation regarding this. Many people have written shell scripts to work around this issue. Recommended discussions are one, two, three, four, five, six.
You can mix and match screenId types across your setup.
displayplacer list
and system prefs only show resolutions for the screen's current rotation.displayplacer list
by executing displayplacer "id:<screenId> mode:<modeNum>"
. Some of the resolutions listed do not work. If you select one, displayplacer will default to another working resolution.displayplacer "id:<screenId> degree:<0/90/180/270>"
displayplacer "id:<screenId> enabled:true"
displayplacer list
output changed slightly in v1.4.0. If this broke your scripts, use displayplacer list --v1.3.0
.
Please create a GitHub Issue for any feedback, feature requests, bugs, Homebrew issues, etc. Happy to accept pull requests too!