Skip to content

aos window

Desktop windows: list, focus, move, resize, arrange

10 commands. Run aos window --help for the same list from the binary, or see every group.

Desktop windows on every platform: list them with geometry, focus one, move it to a zone or exact bounds, resize it, wait for one to appear, and save or apply a whole layout. Zones are 1A/1B for halves, 2A to 2D for quarters and M:N for the M-th of N columns; zones shows them on a real monitor. desktop toggles Show Desktop.

Apply a saved layout of many windows in one pass

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window arrange <layout.json | ->
flag values meaning
<layout.json | -> Required positional argument
Terminal window
aos window arrange ~/.config/aos/layouts/work.json
echo '[{"app":"Google Chrome","zone":"1A"},{"app":"Slack","zone":"1B"}]' | aos window arrange -

Show the desktop (toggle: run again to bring the windows back)

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window desktop
Terminal window
aos window desktop

Bring a window to the front

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window focus <app> | --app=<name> | --title=<substring> [--force]
flag values meaning
<app> One of these is required
--app <name> One of these is required
--title <substring> One of these is required
--force Optional
Terminal window
aos window focus Chrome
# polite: exit 5 when someone used the machine in the last 5s; --force overrides

List open windows

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window list [--app=<name>] [--title=<substring>] [--kind=browser|terminal|editor|files|other] [--json]
flag values meaning
--app <name> Optional
--title <substring> Optional
--kind browser, terminal, editor, files, other Optional
--json Optional
Terminal window
aos window list
aos window list --app=Chrome
aos window list --kind=terminal

Move a window to a zone, a split, or absolute bounds

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window move <app> (--zone=<1A|2:1> | --at=<x,y,w,h>) [--monitor=<n>]
flag values meaning
<app> Required positional argument
--zone 1A, 2:1 One of these is required
--at <x,y,w,h> One of these is required. comma-separated
--monitor <n> Optional
Terminal window
aos window move Chrome --zone=1B
aos window move Chrome --monitor=2 --zone=1:3
aos window move Slack --at=0,25,1920,1055

Resize a window in place

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window resize <app> --w=<width> --h=<height>
flag values meaning
<app> Required positional argument
--w <width> Required
--h <height> Required
Terminal window
aos window resize Chrome --w=900 --h=700

Save the current layout to a file window arrange can apply

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window save <layout.json> [--app=<name>] [--monitor=<n>]
flag values meaning
<layout.json> Required positional argument
--app <name> Optional
--monitor <n> Optional
Terminal window
aos window save ~/.config/aos/layouts/work.json
aos window save ~/work.json --app=Chrome
aos window save ~/second-screen.json --monitor=2

Print all the text of a window, in reading order (accessibility, OCR fallback)

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window text (<app> | --app=<name> | --title=<substring> | --id=<window id> | --focused) [--source=auto|accessibility|ocr] [--json] [--plain] [--max-chars=<n>] [--timeout=<ms>] [--raise]
flag values meaning
<app> One of these is required
--app <name> One of these is required
--title <substring> One of these is required
--id <window id> One of these is required
--focused One of these is required
--source auto, accessibility, ocr Optional
--json Optional
--plain Optional
--max-chars <n> Optional
--timeout <ms> Optional
--raise Optional
Terminal window
aos window text TextEdit
aos window text --focused --max-chars=4000
aos window text --app=Chrome --json
aos window text --id=12345 --source=ocr --raise # OCR a covered window: brings it to the front, then hands focus back
# auto reads the accessibility tree (AX / UI Automation / AT-SPI) and falls back to OCR when it has almost no text
# exit 3 when no window matches

Wait for a window to appear, then print it

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window wait <app> [--timeout=<ms>]
flag values meaning
<app> Required positional argument
--timeout <ms> Optional
Terminal window
aos window wait Chrome --timeout=5000

Show what each zone means on a real monitor

needs a display

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos window zones [--monitor=<n>] [--show]
flag values meaning
--monitor <n> Optional
--show Optional
Terminal window
aos window zones
aos window zones --monitor=2
aos window zones --show --app=Chrome