Window management made easy: I’ll show you how to set up macros in Keyboard Maestro to quickly position your front window to the left, right, or center of either your first or second screen, keeping your workspace organized. You can download the macros below and adjust them if needed.
How it works
Each macro resizes and positions the window based on screen dimensions. The left and right macros set the width to 50% of the screen and move the window to either edge, while the center macro expands the width to 70% and centers the window. The height for all macros is full height minus the menu bar.
How to set it up
Left Alignment Macro
- Add the Move and Resize Front Window action to your new macro.
- ➡️ Set horizontal positioning to:
SCREEN(Main, Left) - ⬇️ Set vertical positioning to:
SCREEN(Main, Top) + MENUBARHEIGHT() - ↔️ Set width to:
SCREEN(Main, Width) * 0.5 - ↕️ Set height to:
SCREEN(Main, Height) - MENUBARHEIGHT()
Right Alignment Macro
- Add the Move and Resize Front Window action to your new macro.
- ➡️ Set horizontal positioning to:
SCREEN(Main, Left) + SCREEN(Main, Width) * 0.5 - ⬇️ Set vertical positioning to:
SCREEN(Main, Top) + MENUBARHEIGHT() - ↔️ Set width to:
SCREEN(Main, Width) * 0.5 - ↕️ Set height to:
SCREEN(Main, Height) - MENUBARHEIGHT()
Center Alignment Macro
- Add the Move and Resize Front Window action to your new macro.
- ➡️ Set horizontal positioning to:
SCREEN(Main, Left) + SCREEN(Main, Width) * 0.15 - ⬇️ Set vertical positioning to:
SCREEN(Main, Top) + MENUBARHEIGHT() - ↔️ Set width to:
SCREEN(Main, Width) * 0.7 - ↕️ Set height to:
SCREEN(Main, Height) - MENUBARHEIGHT()
is used for the primary screen. Replace
MainMain with Second to apply the macro to your secondary display.
Adjust to your needs
You can modify these macros to suit your needs. Adjust the width (e.g., remove * 0,7 for full width on the center macro), duplicate them for additional screens, or adjust the height settings to match your preferences.
For an even faster workflow, assign these macros to Stream Deck buttons using the KMLink addon. This lets you reposition windows with a single press.
For more automation and KM tips, take a look at the category page.
