Save and restore complex Windows desktop layouts from a simple folder, with no installation beyond Windows itself.
This project uses PowerShell plus built-in Windows APIs to:
- Capture the current monitor-aware window arrangement
- Restore named layouts from a text file
- Work across different monitor numbering by matching monitors by position
- Support multiple monitor setups such as
3 monitors,ultrawide, orlaptop - Support both per-window rules and cascade rules for multi-instance apps
- Windows can renumber monitors after events such as screensaver/sleep/wake, but this tool identifies monitors by position rather than number
- Similar home and office monitor layouts can still match even when positions and sizes are close but not identical
- Different monitor resolutions still work because window placement uses percentages instead of fixed pixel coordinates
- Configurations can be copied from computer to computer
The launcher shows layouts in the form:
3 monitors - developer: IDE large, CAD smaller3 monitors - engineer: CAD large, IDE smallerultrawide - developer: IDE on the leftultrawide - engineer: CAD on the leftlaptop - laptop: mostly full-screen windows on a single monitor
You can also apply a layout directly from an interactive terminal or from a shortcut script:
WindowLayout.cmd -ApplyLayout "3 monitors - developer"No dependencies: runs with built-in Windows PowerShell and .NET onlyPortable: works from a folder such as the desktopMonitor setups: separate physical monitor arrangements from window layoutsRelative monitor matching: matches the current monitors to a saved setup by relative position, not Windows numberingCapture workflow: captures the current layout intocurrent_layout.txt, which you can trim and copy intowindow_layouts.txtReadable config: uses a pipe-delimited text format instead of JSONRegex titles: supportsregextitle matching, including|inside regex patternsCascade support: capture emits both a cascade row and individual rows for multi-instance apps
Release zip contents:
WindowLayout.cmd
WindowLayout/
WindowLayout.ps1
readme.txt
window_layouts.txt is created on first run.
current_layout.txt is generated only when you capture a layout.
- Download the release zip and extract it.
- Keep
WindowLayout.cmdnext to theWindowLayoutfolder. - Double-click
WindowLayout.cmd. - Choose a saved layout, or capture the current layout.
- After capture, copy the parts you want from
current_layout.txtintowindow_layouts.txt.
Capture usually sees more windows than you want to keep, including helper windows and some windows that are not obvious to the user. Trim the captured file before keeping it.
The config separates:
MonitorSetup: the physical monitor arrangementLayout: the app/window arrangement for that monitor setup
Example:
[MonitorSetup 3 monitors]
role | x | y
primary | 0 | 0
upper-left | -1600 | 1250
lower-left | -1600 | 2160
[MonitorSetup ultrawide]
role | x | y
primary | 0 | 0
left | -1600 | 1250
[MonitorSetup laptop]
role | x | y
primary | 0 | 0
[Layout developer]
monitorSetup | 3 monitors
processName | title | match | x | y | w | h | monitorRole | cascade
chrome.exe | Main | contains | 20 | 20 | 60 | 70 | primary | no
chrome.exe | Personal | contains | 0 | 0 | 30 | 100 | lower-left | no
ms-teams.exe| | contains | 45 | 0 | 55 | 100 | upper-left | no
That shows the main idea:
- monitor setups describe the physical arrangement
- Layouts describe where apps go inside that setup
- A row with a title targets a specific window pattern
- A row with an empty title can target any window from that process
Excel example:
[Layout engineer]
monitorSetup | 3 monitors
processName | title | match | x | y | w | h | monitorRole | cascade
excel.exe | Visual Basic | contains | 2 | 0 | 60 | 100 | primary | no
excel.exe | - Excel$ | regex | 60 | 10 | 35 | 40 | primary | yes
That shows a useful pattern:
- The Excel VBA editor (
Visual Basic) is pinned on the left - All normal workbook windows (
- Excel$) are handled together withcascade = yes - In regex mode,
- Excel$means the title ends with- Excel;$marks the end of the title
WindowLayout.cmd
WindowLayout.cmd -ListLayouts
WindowLayout.cmd -CaptureCurrent
WindowLayout.cmd -ApplyLayout "3 monitors - developer"This repo includes a packaging script:
.\build-release.ps1It creates dist\WindowLayout.zip with the deployable files only.
MIT. See LICENSE.