← Hammerdeck

Put your windows back when a monitor reconnects

Take a MacBook away from its desk and every window on the external display lands on the laptop screen. Plug it back in, and putting each one back where it was is your job.

The fix is to capture the arrangement once and let a rule rebuild it whenever that display connects. Hammerdeck does this for free, with no scripting: about two minutes of setup.

The external display is unplugged and everything piles onto the laptop; it is plugged back in and a rule puts all four windows back.

Set it up once

  1. With the monitor connected, arrange your windows on it the way you want them. Keep Hammerdeck's own windows on the laptop screen, so they aren't captured too.
  2. Click Hammerdeck's menu bar icon, choose Rules…, and pick the recipe Arrange windows on dock (“Snap your windows into place when a display connects”).
  3. The rule reads “When display connects”. Click the display name and make sure it is your external monitor, not the laptop's built-in screen: the next step captures only windows on the display named here.
  4. Click Capture current layout. Every window on that monitor is recorded: its app, and its exact position and size.
  5. Click Add rule.

From then on, each time that monitor connects, by cable or through a dock, the captured windows go back onto it in the same places. To try it without unplugging, drag a couple of those windows onto the laptop screen, then click the ▶ next to the rule in the list. With several monitors, make one rule per display.

What to expect

And by hand, in between

For the moves you make all day, ⌃⌥⌘] throws a window to the next display and ⌃⌥⌘Z undoes the last move. More in moving a window to another display.

Other ways to do it

Hammerdeck, Rectangle or Moom compares them in more detail.

Hammerdeck is free and open source (GPL), notarized by Apple, and runs on macOS 13 and later.

Download Hammerdeck

Or brew install --cask kouxing2000/tap/hammerdeck