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.
01Command
$ brew install displayplacer && displayplacer list02What 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
04Undo
$ 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
- GitHub - jakehilborn/displayplacer: macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS. · GitHubEvidence: Install via Homebrew with brew install displayplacer or visit the releases tab.
Last verified: 2026-09-21 · Category: System & Settings
06Related solutions
Erase the broken Spotlight database so macOS re-indexes your drive from scratch.
Point macOS screen captures at any folder you choose instead of the desktop.
Grab any file from the web straight into the current folder — no browser needed.