Monarch: A Minimalist Tool to Tame Your Display Layouts
Ever had to unplug your laptop from that perfect multi-monitor setup at your desk, only to spend 10 minutes wrestling with window positions when you plug it back in? Or maybe you have a few specific app layouts for different tasks—coding, writing, research—and you’re tired of manually arranging windows every time you switch contexts.
That daily friction is exactly what Monarch aims to solve. It’s a small, focused tool built in Rust that does one thing well: it lets you detach your current display layout and restore it later, with a simple command.
What It Does
Monarch is a command-line utility that manages window layouts across display changes. In simple terms, you can "detach" your current arrangement of open application windows, disconnect your monitors, and later "restore" that exact layout when you reconnect them. It saves the position and state of your windows, so everything pops back right where you left it.
Why It’s Cool
The beauty of Monarch is in its minimalism and its specific use case. It’s not a full-blown window manager or a complex desktop environment tool. It’s a lightweight script that hooks into system APIs to query window positions and then reapply them. This makes it fast, reliable, and easy to reason about.
It’s particularly clever for developers and power users who work in dynamic environments. Think about:
- Hybrid Workers: Seamlessly transition between a multi-monitor desk setup and a single laptop screen without the chaos.
- Task-Based Layouts: Save a "coding" layout (editor, terminal, browser dev tools) and a "communication" layout (Slack, email, calendar) and switch between them.
- Presentations: Quickly arrange windows for a demo, then revert to your working layout afterward.
Because it’s written in Rust, it’s also snappy and compiles down to a single binary with no heavy runtime dependencies. It’s the kind of tool that sits quietly in your workflow and just works.
How to Try It
Getting started with Monarch is straightforward. You’ll need Rust and Cargo installed on your system.
Clone the repository:
git clone https://github.com/Nuzair46/Monarch cd MonarchBuild the project:
cargo build --releaseThe binary will be in
./target/release/. You can run it directly from there or move it to a directory in your PATH.
Basic usage involves two main commands:
- To save your curren