window_dock
Dock a window to a screen corner with optional always-on-top pinning, or pin/unpin a window to stay on top. Restores minimized windows before docking.
Instructions
Purpose: Decorate a window: pin (always-on-top), unpin, or dock (move + resize + optional pin). Details: action='pin' makes window always-on-top until unpin/duration_ms. action='unpin' removes always-on-top. action='dock' positions to corner with width/height (default 480×360 bottom-right) and optionally pins. Minimized windows are automatically restored before docking. Prefer: Use action='dock' for terminal/CLI window auto-positioning at session start. Use action='pin' alone when you only need always-on-top without moving or resizing. Caveats: Pin survives minimize/restore; explicit action='unpin' needed to release. Dock fails on elevated processes. Dock overrides any existing Win+Arrow snap arrangement. Examples: window_dock({action:'dock', title:'PowerShell', corner:'bottom-right', width:480, height:360}) window_dock({action:'pin', title:'Settings', duration_ms:5000}) window_dock({action:'unpin', title:'Settings'})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action selector — one of: pin, unpin, dock. Per-action required fields are enforced at call time (see the tool description); this flat schema lists every action's fields as optional. | |
| title | No | Partial window title (case-insensitive) | |
| duration_ms | No | Auto-unpin after this many ms (0–60000). Omit to pin indefinitely. | |
| include | No | Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients). | |
| corner | No | Screen corner to snap the window to. Default 'bottom-right'. | bottom-right |
| width | No | Window width in pixels after docking. Default 480. | |
| height | No | Window height in pixels after docking. Default 360. | |
| pin | No | If true, set always-on-top so the docked window stays visible on top of other windows. Use window_dock(action='unpin') to remove the topmost flag later. Default true. | |
| monitorId | No | Monitor to dock on (from desktop_state({includeScreen:true})). Omit for primary monitor. | |
| margin | No | Pixel padding between the window and the screen edge. Default 8. |