Skip to content

Latest commit

 

History

History
269 lines (230 loc) · 19.3 KB

controls.md

File metadata and controls

269 lines (230 loc) · 19.3 KB

Controls

Spaceman registers global hotkeys while automatic tiling is enabled and refreshes character keys after macOS input-source changes. If a layout change cannot build a replacement plan, existing registrations stay active; if re-registration fails after releasing old chords, Spaceman pauses and reports Hotkeys unavailable.

Keys Action
Option+1 … Option+9, Option+0 Switch to workspace 1 … 10
Option+Shift+1 … Option+Shift+0 Move the focused window to workspace 1 … 10 without switching
Option+A … Option+Z Switch to that enabled named workspace
Option+Shift+A … Option+Shift+Z Move the focused window to that enabled named workspace
Option+Tab Focus the previously focused workspace across displays
Option+Shift+Tab Move the focused workspace to the next display (left to right)
Option-backtick / +Shift Focus the next or previous window on the workspace (tiles, then floats, wrapping)
Option+H/J/K/L Focus the nearest tile left/down/up/right, including across displays
Option+Shift+H/J/K/L Move or nest the focused tile in that direction
Option+/ Toggle the active workspace layout's root horizontal/vertical axis
Option+- / Option+= Shrink or grow the focused tile by 50 points at its immediate split
Option+Shift+F Toggle workspace-wide Fullscreen Layout without macOS native fullscreen
Option+Shift+Space Float the focused window above the tiles, or tile it again
3- or 4-finger swipe left/right Step to the next or previous occupied workspace on the display under the pointer

Horizontal trackpad swipes step through the display's visible and occupied workspaces, stopping at either end and following macOS Natural scrolling (read live on every swipe). Finger count (Off, 3 fingers, 4 fingers), travel distance (Short 6%, Normal 15%, Long 25%, or 3–40%), scroll/momentum suppression, and macOS Spaces gesture coordination are configured in Settings › Shortcuts or config.toml; see Configuration › Trackpad Swipe. With [labs] swipe_scrub = true (Interactive swipe picker in Settings › Labs), a swipe opens the Workspace HUD on that display and glides its marker continuously with your fingers (using your swipe threshold as half a step, or stepping discretely under Reduce Motion): reversing moves back, returning to the starting workspace cancels, and lifting elsewhere switches straight there.

Every shortcut can be rebound, unbound ("none"), or moved to another base modifier (⌥, ⌃⌥, or ⌃⌥⌘) in Settings › Shortcuts or [shortcuts] in config.toml; [shortcuts.bindings] claims chords first, enabled named workspace letters win over overlapping built-in letters next, and [shortcuts] option_click_keep_visible (default true) keeps the current app visible when Option-clicking another app's window while tiling (see Configuration › Shortcuts).

Focus, Fullscreen Layout, Float, and Tiling

Spaceman remembers each workspace's last-focused window (tile or float, keeping the last tile as a fallback) and focuses only that window so sibling windows of the same app on other displays stay behind whatever covers them. Pressing an already-focused workspace's switch shortcut again cycles its tiles in stable order (if focus is on another display, the first press brings focus back and the second cycles); clicking an active workspace in the menu bar or HUD keeps current focus. Choosing an empty workspace makes it the target for subsequent commands until another window takes focus. Externally activating a window on a hidden workspace (via the Dock, notifications, or native ⌘Tab) switches its display to that workspace; pinned windows never trigger a switch. Option+Shift+Tab (ctl move-workspace) moves the focused workspace to another display, promotes the source display's previous workspace, parks the displaced target workspace, preserves Fullscreen Layout and focus, and persists the monitor assignment (or swaps matching 1–10 workspaces when per_display_workspaces = true).

Fullscreen Layout (Option+Shift+F, indicated by a filled menu-bar glyph) gives every tiled window the full padded display area (centered within single_window_max_width and single_window_max_height when set) and raises the focused tile. Option+H/K and Option+L/J step backward and forward through the stack without wrapping, continuing onto adjacent displays past either end; Option-backtick wraps through tiles and floats, and Command-backtick cycles same-app windows as usual. Leaving the workspace parks stacked windows back-to-front so covered tiles never flash. Fullscreen Layout survives new tiles, switches, native-tab replacements, and restarts, and holds across ⌘H, ⌘M, or native fullscreen when every tile leaves temporarily (exiting if the last tile closes or moves away, another window arrives first, or Spaceman restarts). Option+/ exits Fullscreen Layout and flips the root split axis; resize, balance, and drag/reorder require leaving Fullscreen Layout first.

Floating (Option+Shift+Space) lifts a tile out of the split tree (re-filling its space) into a centered card at 72% × 78% of the work area, capped at 1280 × 860 pt and never larger than the tile it left, or restores its previous float frame. Floating state follows the window across switches, native-tab selections, minimize/hide, and restarts until the window closes or Option+Shift+Space retiles it (rule-floated and non-resizable windows stay floating). Dragging a float so its center lands on another display hands it to that display's visible workspace at the dropped frame.

Reflow, sizing, and pointer drags: Minimizing (⌘M) or hiding (⌘H) reflows siblings immediately (macOS native fullscreen retires the slot after 2 s; on exit the window returns to its previous split position beside the same neighbors), and returning to another macOS Space restores saved splits, weights, Fullscreen Layout, and focus when the same live windows remain. Option+Shift+H/J/K/L swaps or nests tiles and crosses onto adjacent displays. When a window refuses its assigned size, Spaceman expands that tile to its minimum and shrinks siblings proportionally, temporarily stacking an adjacent root pair on the other axis if needed until space allows. Pointer-dragging a tile swaps over a sibling, nests near a tile edge, moves across displays to the workspace visible at mouse-up, or docks into a full-height half-width column along the display's left/right edge once the pointer has left that edge band (portrait displays add top/bottom half-height bands too, with side bands winning in corners including menu-bar and Dock strips). Pointer-resizing updates split weights. Previews are non-destructive and commit on mouse-up; keyboard layout/workspace commands during a drag are preserved, and aborted drags restore the saved layout.

Input queue and switch rollback: While the worker is busy, up to 64 keyboard commands and completed pointer gestures queue in arrival order without collapsing repeats, preempting background retiles between per-app reads (Input queue full; command was not queued rejects excess input and returns non-zero to spaceman ctl; pause, quit, or hotkey loss clears the queue). Pointer tracking reads window-server geometry without main-thread Accessibility calls. Workspace switches reveal incoming parked windows before hiding outgoing ones; if window-server confirmation times out, the switch rolls back and re-parks pending incoming windows.

Send Tab to Workspace

spaceman ctl move-tab WORKSPACE [--follow] detaches the focused window's active native tab via the app's own Move Tab to New Window menu item (moveTabToNewWindow: or localized/Chromium title in Safari, Finder, Terminal, Ghostty, TextEdit, Preview, Chrome, Brave, and others) and routes the new window straight to WORKSPACE ahead of any route rule, keeping focus on the source window unless --follow is passed. Single-tab windows and apps without that menu command move the whole window like ctl move. Tabs that do not produce a window within 800 ms stay where the app placed them, and queued move-tab calls serialize across that 800 ms window so rapid sends from one tab group land cleanly. Bind a chord in [shortcuts.bindings], such as "ctrl+alt+shift+2" = "move-tab 2".

Scratchpad (Lab)

With [labs] scratchpad = true (Configuration › Labs), Spaceman registers two Scratchpad shortcuts while tiling:

Keys Action
Option+Shift+\ Hide the focused window in the scratchpad, or retile a shown scratchpad window
Option+\ Summon the next scratchpad window centered on the focused display, or hide the shown one

Marking a window drops any pin, reflows its workspace, and parks it off-screen with its recovery frame in parked-windows.json. Summoning floats it at its last float size (or 75% of the display on first summon) above the current tiles; switching workspaces hides a shown scratchpad window again, and Dock / native ⌘Tab activation does not summon hidden scratchpad windows (use Option+\ or spaceman ctl scratchpad toggle). Moving a scratchpad window to a workspace, pressing Option+Shift+Space or Option+Shift+\ while shown, pausing, quitting, restarting, or turning the Lab off returns it on screen as a normal window (scratchpad membership does not persist across restarts).

Window Overlay (Lab)

With [labs] window_overlay = true (Configuration › Labs), holding [shortcuts] modifier + Shift (Option+Shift by default) alone for 150 ms (320 ms within 2 s of a key press) dims the window under the pointer (or the focused window over desktop/menu bar) and shows a non-activating card with the app's icon and name (never window titles):

Control Action
1…0, A–Z, + Send the window to a visible/occupied workspace (grouped by Display N) or the display's next empty workspace (+)
Float / Pin / Fullscreen Toggle float, pin across workspaces on its display, or workspace Fullscreen Layout with this tile in front
← ↑ ↓ → Swap the tile with its neighbor in that direction

Moving the pointer onto another window moves the card there (unless hovering or pressing on the card itself); clicking controls acts without moving focus or the pointer, and releasing either modifier, pressing another key, holding ⌘/⌃, or dragging dismisses the overlay.

⌘Tab Switcher (Lab)

With [labs] command_tab = true (Configuration › Labs) and tiling active, ⌘Tab and ⌘⇧Tab switch windows across every workspace in most-recently-used order. Releasing ⌘ within 120 ms switches straight to the previous window without UI; holding ⌘ or pressing Tab again opens the Desk Switcher:

Key Action
Tab / ⇧Tab Next or previous app (MRU order), selecting its most recent window
backtick / ⇧ backtick Next or previous window of the selected app
← → or H L Previous or next workspace (including empty workspaces)
↓ / J · ↑ / K Step down into workspace desks and windows · return to the app row
1–9 Select that workspace
D Filter to the current workspace's windows, or show all workspaces again
M Move the selected window to the current workspace and focus it
F Toggle float on the selected window (when its workspace is on screen)
Q / ⇧H Quit or hide the selected window's app
Esc Dismiss without switching

The top pill shows running apps in MRU order; below it, each workspace renders its live tile layout as a desk across displays alongside orbs for floating and Scratchpad windows (app icons and names only, never window titles; fades in place under Reduce Motion). Click any app, window, or desk to switch, or drag a window/app icon onto another desk or the float orb to move, float, or retile it.

⌘Tab itself works during Secure Input (⌘ chords still deliver), while single-key actions inside the open switcher require Secure Input off (Tab, Esc, arrows, and 1–9 read physical keys; letters and backtick follow the active keyboard layout). Native Dock ⌘Tab is left alone if another app (such as AltTab) already disabled it, and returns automatically on pause, shortcut recording, setup-tour practice, quit, or crash (or manually via spaceman ctl restore-command-tab; reported in spaceman doctor as symbolic_cmd_tab_override).

Menu

The menu-bar item shows active workspace/layout glyphs (Settings › General › Menu bar icon: Full, Compact, or Off via settings.menu_bar_icon) and runtime errors:

  • Setup Tour… (shown while Accessibility permission is missing)
  • Per-display active and occupied workspaces (while tiling), with app icons and shortcut hints
  • Pause Tiling / Resume Tiling
  • Workspace HUD (toggles settings.hud; right-clicking an app icon inside the visible HUD capsule edits its Float/Tile, Pin/Unpin, or Always open on Workspace N rule)
  • Launch at Login (or Launch at Login (Approval Required...) to open Login Items settings)
  • Settings... (⌘,, opening General, Layout, Rules, Workspaces, Shortcuts, Activity when [labs] activity = true, and Labs, plus ⇧⌘D Playground)
  • Check for Updates..., or Install Spaceman <version> and Restart when a verified update is staged
  • Quit Spaceman (⌘Q)

Settings › General also includes Setup tour (Run) and a bottom Quit Spaceman (Pause & restore windows / Quit) row for when menu_bar_icon = "off", plus Updates (Stable or Dev channel). Pause, quit (15 s timeout), and update installs (45 s timeout) restore parked windows before completing; see Recovery and Releasing.

CLI

Homebrew (anomalyco/tap/spaceman) links $(brew --prefix)/bin/spaceman, scripts/install-app.sh links ~/.local/bin/spaceman, and direct ZIP installs bundle /Applications/Spaceman.app/Contents/MacOS/spaceman. Layout commands require automatic tiling.

Command Action
spaceman ctl status Print mode, busy, active_workspaces, and last_error JSON
spaceman ctl debug Print title-free displays, tiles, floats, directional targets, and parking_exempt JSON
spaceman ctl settings Print agent-only Settings state JSON
spaceman ctl switch WORKSPACE|next|prev Switch to workspace 1–10 / enabled A–Z (repeats cycle tiles), or step along the display
spaceman ctl switch-target WORKSPACE [--window ID | --slot ID] Switch to WORKSPACE and focus one exact window or slot without repeat cycling
spaceman ctl back-and-forth Focus the previously focused workspace (Option+Tab)
spaceman ctl move-workspace [next|prev|DISPLAY] Move the focused workspace to another display (default next)
spaceman ctl move WORKSPACE|next|prev [--follow] Move the focused window to a workspace or step along its display
spaceman ctl move-tab WORKSPACE [--follow] Send the focused window's active tab to WORKSPACE (Send Tab to Workspace)
spaceman ctl move-app BUNDLE_ID WORKSPACE Move every managed window of BUNDLE_ID to WORKSPACE
spaceman ctl focus left|down|up|right|next|prev Focus in a direction (including empty adjacent displays) or cycle workspace windows
spaceman ctl move-direction left|down|up|right Move or nest the focused tile in that direction
spaceman ctl layout / fullscreen / float / pin Toggle root split axis, Fullscreen Layout, floating, or cross-workspace pin
spaceman ctl resize shrink|grow Shrink or grow the focused tile by 50 points at its immediate split
spaceman ctl resize width|height POINTS Resize the focused window to 1–16384 points (gaps excluded; siblings clamped >= 50 pt)
spaceman ctl balance / retile Equalize the immediate split (respecting minimums) / force an immediate observation and retile
spaceman ctl scratchpad toggle|mark Summon/hide or mark/unmark a scratchpad window ([labs] scratchpad)
spaceman ctl pause / resume Pause (restoring parked windows) or resume automatic tiling
spaceman ctl wrong Mark journal.jsonl and capture a full arrangement snapshot immediately
spaceman ctl restore-command-tab Re-enable native Dock ⌘Tab/⌘⇧Tab (works even when the agent is stopped)
spaceman ctl open TARGET Open Settings to a spaceman:// deep link, pane, feature, or Lab (alias: spaceman open TARGET)
spaceman ctl open-settings / open-accessibility / check-for-updates / toggle-launch-at-login Trigger the corresponding menu or Settings action
spaceman ctl restart / quit Restore parked windows and exit the agent (restart does not relaunch on its own)
spaceman config / rules / workspaces / config-check Inspect, validate, and edit config.toml (Configuration)
spaceman displays / snapshot / hud / doctor [HOURS] Connected displays JSON, dry-run observation JSON, live terminal HUD, or journal summary
spaceman replay <fixture.json> / retile / watch / watch-window / run Offline fixture replay and dry-run or --apply reconciliation probes (Development)

doctor reads journal.jsonl directly (even while the agent is stopped) and summarizes agent starts, exit restorations, recalled or unclaimed placements, manual moves within 120 s of placement, ctl wrong markers, live Secure Input / symbolic_cmd_tab_override / event_tap_timeout counters, the last known per-workspace arrangement, and debounced (>= 3 s) model/screen anomalies:

Kind Meaning
leaked Owned by a hidden workspace and not parked, yet on a display
stranded Owned by a visible workspace and not parked, yet off every display
parked_visible Recorded as parked, yet visible on a display
unadopted Managed by config and on a display, but owned by no workspace
constrained_overlap A size-clamping tile overlaps another visible tile on its workspace
misplaced Tiled on a visible workspace more than 16 px from its layout target
missing Owned, but no longer listed by the window server
parking_exempt Left visible across switches after repeatedly un-parking itself

The agent listens on mode-0600 ~/Library/Application Support/Spaceman/control.sock (single-agent lock control.lock, newline-delimited requests up to 4 KiB).

Deep Links (spaceman://)

Spaceman registers spaceman:// (and web bounce links under https://anoma.ly/spaceman/labs/<slug>, /features/<slug>, /settings/<pane>, and /open/?to=...) to open Settings and highlight a pane, feature, or Lab:

  • spaceman://settings[/<pane>[/<focus>]]: general, layout, rules, workspaces, shortcuts, activity (falls back to general while [labs] activity = false), or labs
  • spaceman://labs[/<slug>]: scratchpad, activity, focus-follows-mouse, window-overlay, command-tab, or swipe-scrub
  • spaceman://features/<slug>: feature jump such as workspaces, rules, shortcuts, gaps, hud, menu-bar-icon, mouse-follows-focus, or single-window-height

Deep links never mutate config.toml, enable a Lab, or execute tiling commands; malformed or percent-encoded URLs are rejected.