Apply a window layout preset
hs_window_layoutSnap any window to preset layouts (halves, thirds, quarters) using screen dimensions; auto-accounts for menu bar and Dock, with optional target display and window selection.
Instructions
Snap a window to a named position such as left-half or quarter-top-left, computed from the screen size so no pixel arithmetic is needed. Defaults to the focused window. Positions respect the menu bar and Dock.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"preset": "<preset>"
},
"name": "hs_window_layout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preset | Yes | Named layout to apply. | |
| windowId | No | Window id from hs_list_windows. Defaults to the focused window. | |
| screenIndex | No | Zero-based screen index from hs_screens. Defaults to the screen the window is already on. Use this to move a window to another display and position it in one call. |