Rearrange Displays or Change Resolution from the Terminal with displayplacer

Use the displayplacer utility to list screen IDs and modes, change resolutions, rotate screens, set the primary display, and arrange multi-monitor layouts — all from the macOS command line.

macOSTerminalDiagnosticsLow risk
Install displayplacer with Homebrew, run `displayplacer list` to see screen IDs and available modes, then apply a configuration like `displayplacer "id:<screenId> res:<width>x<height> origin:(<x>,<y>) degree:0"`. The screen placed at origin (0,0) becomes the primary display.

01Command

Command
$ brew install displayplacer && displayplacer list

02What it does

displayplacer is a macOS command line utility to configure multi-display resolutions and arrangements — essentially XRandR for macOS. Start with `displayplacer list`, which shows your current screen info and possible resolutions, and prints the args for your current layout so you can save them as a profile for scripting or hotkeys. Then apply a config: set res, hz, color_depth (optional — highest are auto-applied if omitted), scaling, origin, and degree (0/90/180/270). To mirror displays, combine IDs like `id:<mainScreenId>+<mirrorScreenId>`. You can also apply a specific mode with `displayplacer "id:<screenId> mode:<modeNum>"`, disable a screen with `enabled:false`, or rotate the internal MacBook screen. Note that screenIds can occasionally change when external displays wake in a non-deterministic order; displayplacer offers persistent, contextual, and serial screenIds you can mix and match.

03Risk

RiskLow risk
RequirementsHomebrew (or manual install from the GitHub releases tab).
!Warning: Some resolutions listed by displayplacer list do not actually work; if you pick one, displayplacer will default to another working resolution. Also, if you disable a screen you may need to unplug/replug it to bring it back.

04Undo

Undo
$ Run `displayplacer list` before changing anything and re-apply the saved args later, e.g. displayplacer "id:<screenId> res:<width>x<height> hz:<num> color_depth:<num> scaling:<on/off> origin:(<x>,<y>) degree:<0/90/180/270>"

05Sources

Last verified: 2026-09-21 · Category: System & Settings

06Related solutions