DEV Community

Giridharan Manivannan
Giridharan Manivannan

Posted on

Edit display layout on Macos with displayplacer

Having a giant external monitor is great, love the extra real estate that you get. But it's pesky when you need to switch your mac close-by or switch it back into the dock.

Add to this a constant need to ensure your layout matches the physical arrangement, and you end up with a silly amount of time navigating Displays > Arrange and making the layout look just right.

And it has been a terrible experience all round, until recently when I ran into displayplacer. They describe themselves as XRandR for Macos and that's it. Problem solved.

Once you install displayplacer, You can have any number of display layouts and arrangements configured, whose config you can gather up as a command which looks something like the below.

displayplacer "id:BCXXXXXX-DXXX-4XXX-8XXX-D1XXXXXXXXXX res:3008x1692 hz:60 color_depth:8 enabled:true scaling:on origin:(0,0) degree:0" "id:37XXXXXX-2XXX-0XXX-BXXX-8FXXXXXXXXXX res:1512x982 hz:120 color_depth:8 enabled:true scaling:on origin:(957,1692) degree:0"
Enter fullscreen mode Exit fullscreen mode

The command looks unwieldy at first, and it can get can get increasingly longer the more displays you have. The above is an example of a two display setup, but this illustrates the point.

However, To make it's usage a lot easier, the list subcommand, gives you options for each device and layout and even more helpfully, returns the current config as the above string.

So, once you have each of your arrangements as a displayplacer command, save it as an alias to each config and you can switch between each from the terminal or as a result of any automation that you set up.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️