AeroSpork is an i3-like tiling window manager for macOS

300

Commands documentation is also available as manpages.

1. balance-sizes

balance-sizes [-h|--help] [--workspace <workspace>]

Balance sizes of all windows in the current workspace

OPTIONS

-h, --help

Print help

--workspace <workspace>

Act on the specified workspace instead of the focused workspace

2. close

close [-h|--help] [--quit-if-last-window] [--window-id <window-id>]

Close the focused window

Normally, you don’t need to use this command, because macOS offers its own cmd+w binding. You might want to use the command from CLI for scripting purposes

OPTIONS

-h, --help

Print help

--quit-if-last-window

Quit the app instead of closing if it’s the last window of the app

--window-id <window-id>

Act on the specified window instead of the focused window

3. close-all-windows-but-current

close-all-windows-but-current [-h|--help] [--quit-if-last-window]

On the focused workspace, close all windows but current

OPTIONS

-h, --help

Print help

--quit-if-last-window

Quit the apps instead of closing them if it’s their last window

4. enable

enable [-h|--help] toggle
enable [-h|--help] on [--fail-if-noop]
enable [-h|--help] off [--fail-if-noop]

Temporarily disable window management

When you disable AeroSpork, windows from currently invisible workspaces will be placed to the visible area of the screen

Key events are not intercepted when AeroSpork is disabled

While disabled, the server rejects every other command — including query commands — with a non-zero exit code and the message "server is disabled and doesn’t accept commands". aerospork enable on|off|toggle is the one exception. -h|--help and -v|--version still work because the CLI answers them without contacting the server

OPTIONS

-h, --help

Print help

--fail-if-noop

Exit with non-zero exit code if already in the requested mode

5. exec-and-forget

exec-and-forget <bash-script>   # config only, not available in CLI

Run /bin/bash -c '<bash-script>', and don’t wait for the command termination. Stdout, stderr and exit code are ignored.

For example, you can use this command to launch applications:

alt-enter = 'exec-and-forget open -n /System/Applications/Utilities/Terminal.app'

<bash-script> is passed "as is" to bash without any transformations and escaping. <bash-script> is treated as suffix of the TOML string, it’s not even an argument in classic CLI sense

  • The command is available in config

  • The command is NOT available in CLI

6. Environment

The script inherits AeroSpork’s full environment, including any secrets in it: API tokens, credentials, anything exported by your shell profile at launch. This is deliberate, since a script that posts to Slack needs its token. But it means the config file is trusted input.

Treat an exec-and-forget line copied from the internet exactly as you would treat a line you were about to paste into your shell.

aerospork list-exec-env-vars redacts secret-looking values by default when displaying them; that is a shoulder-surfing guard only and does not change what the child process receives. Use --show-secrets to see the real values.

AeroSpork adds, when the command has a target, AEROSPORK_WINDOW_ID or AEROSPORK_WORKSPACE; and for commands run by on-focused-workspace-changed, AEROSPORK_FOCUSED_WORKSPACE and AEROSPORK_PREV_WORKSPACE.

Set [exec] inherit-env-vars = false to start from an empty environment, and [exec] env-vars to declare exactly what should be passed through.

7. flatten-workspace-tree

flatten-workspace-tree [-h|--help] [--workspace <workspace>]

Flatten the tree of the focused workspace

Use it when resetting a layout is quicker than repairing it by hand.

OPTIONS

-h, --help

Print help

--workspace <workspace>

Act on the specified workspace instead of the focused workspace

8. focus

focus [-h|--help] [--ignore-floating]
      [--boundaries <boundary>] [--boundaries-action <action>]
      (left|down|up|right)
focus [-h|--help] --window-id <window-id>
focus [-h|--help] --dfs-index <dfs-index>

Set focus to the nearest window in the given direction

Unlike i3, focus has no separate argument for floating windows. It treats them as part of the tree, which removes the need for a separate binding. Pass --ignore-floating to turn that off.

focus child|parent is not supported.

OPTIONS

-h, --help

Print help

--boundaries <boundary>

Defines focus boundaries.
<boundary> possible values: (workspace|all-monitors-outer-frame).
The default is: workspace

--boundaries-action <action>

Defines the behavior when requested to cross the <boundary>.
<action> possible values: (stop|fail|wrap-around-the-workspace|wrap-around-all-monitors)
The default is: stop

--window-id <window-id>

Focus the window with specified <window-id>

--dfs-index <dfs-index>

Focus window by its index, based on a depth-first search (DFS) of the window within the workspace tree. Index is 0-based.

--ignore-floating

Don’t treat floating windows as part of the tree. Useful for more predictable scripting.

9. focus-back-and-forth

focus-back-and-forth [-h|--help]

Switch between the current and previously focused elements back and forth. The element is either a window or an empty workspace.

AeroSpork stores only one previously focused window in history, which means that if you close the previous window, focus-back-and-forth has no window to switch focus to. In that case, the command will exit with non-zero exit code.

That’s why it may be preferred to combine focus-back-and-forth with workspace-back-and-forth:

aerospork focus-back-and-forth || aerospork workspace-back-and-forth

OPTIONS

-h, --help

Print help

10. focus-monitor

focus-monitor [-h|--help] [--wrap-around] (left|down|up|right)
focus-monitor [-h|--help] [--wrap-around] (next|prev)
focus-monitor [-h|--help] <monitor-pattern>...

Focus monitor by relative direction, by order, or by pattern

OPTIONS

-h, --help

Print help

--wrap-around

Make it possible to wrap around focus

ARGUMENTS

(left|down|up|right)

Focus monitor in direction relative to the focused monitor

(next|prev)

Focus next|prev monitor in the order they appear in the menu bar icon

<monitor-pattern>…​

Find the first matching monitor and focus it. Multiple monitor patterns are useful for covering different monitor configurations. Monitor patterns follow the same format as in the [monitors] config section (previously workspace-to-monitor-force-assignment, still accepted)

11. fullscreen

fullscreen [-h|--help]     [--window-id <window-id>] [--no-outer-gaps]
fullscreen [-h|--help] on  [--window-id <window-id>] [--no-outer-gaps] [--fail-if-noop]
fullscreen [-h|--help] off [--window-id <window-id>] [--fail-if-noop]

Toggle the fullscreen mode for the focused window

Switching to a different tiling window within the same workspace while the current focused window is in fullscreen mode results in the fullscreen window exiting fullscreen mode.

OPTIONS

-h, --help

Print help

--no-outer-gaps

Remove the outer gaps when in fullscreen mode

--fail-if-noop

Exit with non-zero exit code if already fullscreen or already not fullscreen

--window-id <window-id>

Act on the specified window instead of the focused window

ARGUMENTS

on, off

on means enter fullscreen mode. off means exit fullscreen mode. Toggle between the two if not specified

12. join-with

join-with [-h|--help] [--window-id <window-id>] (left|down|up|right)

Put the focused window and the nearest node in the specified direction under a common parent container

EXAMPLES

Given this layout

h_tiles
├── window 1
├── window 2 (focused)
└── window 3

join-with right will result in the following layout

h_tiles
├── window 1
└── v_tiles
    ├── window 2 (focused)
    └── window 3
Note
join-with is a high-level replacement for i3’s split command. The reason to split a node is almost always to put several windows under a common parent, which is what join-with does directly. Unlike split, it works with enable-normalization-flatten-containers enabled.

OPTIONS

-h, --help

Print help

--window-id <window-id>

Act on the specified window instead of the focused window

13. layout

layout [-h|--help] [--window-id <window-id>]
       (h_tiles|v_tiles|h_accordion|v_accordion|tiles|accordion|horizontal|vertical|tiling|floating)...

Change layout of the focused window to the given layout

If several arguments are supplied then finds the first argument that doesn’t describe the currently active layout, and applies the layout.

  • Change both tiling layout and orientation in one go: h_tiles|v_tiles|h_accordion|v_accordion

  • Change tiling layout but preserve orientation: tiles|accordion

  • Change orientation but preserve layout: horizontal|vertical

  • Toggle floating/tiling mode: tiling|floating

Deprecated (but still supported) layout names: list, h_list, v_list for tiles, h_tiles, v_tiles

OPTIONS

-h, --help

Print help

--window-id <window-id>

Act on the specified window instead of the focused window

EXAMPLES

  • Toggle between floating and tiling layouts (order of args doesn’t matter):
    aerospork layout floating tiling

  • Toggle orientation (order of args doesn’t matter):
    aerospork layout horizontal vertical

  • Toggle between tiles and accordion layouts (order of args doesn’t matter):
    aerospork layout tiles accordion

  • Switch to tiles layout. Toggle the layout orientation if already in tiles layout:
    aerospork layout tiles horizontal vertical

14. macos-native-fullscreen

macos-native-fullscreen [-h|--help] [--window-id <window-id>]
macos-native-fullscreen [-h|--help] [--window-id <window-id>] [--fail-if-noop] on
macos-native-fullscreen [-h|--help] [--window-id <window-id>] [--fail-if-noop] off

Toggle macOS fullscreen for the focused window

OPTIONS

-h, --help

Print help

--fail-if-noop

Exit with non-zero exit code if already fullscreen or already not fullscreen

--window-id <window-id>

Act on the specified window instead of the focused window

ARGUMENTS

on, off

on means enter fullscreen mode. off means exit fullscreen mode. Toggle between the two if not specified

15. macos-native-minimize

macos-native-minimize [-h|--help] [--window-id <window-id>]

Minimize focused window

OPTIONS

-h, --help

Print help

--window-id <window-id>

Act on the specified window instead of the focused window

16. mode

mode [-h|--help] <binding-mode>

Activate the specified binding mode

See the guide for documentation about binding modes

OPTIONS

-h, --help

Print help

17. move

move [-h|--help] [--window-id <window-id>] [--boundaries <boundary>] [--boundaries-action <boundary-action>] (left|down|up|right)

Move the focused window in the given direction. See the "Examples" section for more details.

Deprecated name: move-through

OPTIONS

-h, --help

Print help

--window-id <window-id>

Act on the specified window instead of the focused window

--boundaries <boundary>

Defines move boundaries.
<boundary> possible values: (workspace|all-monitors-outer-frame).
The default is: workspace

--boundaries-action <boundary-action>

Defines the behavior when requested to move across the <boundary>.
<boundary-action> possible values: (stop|fail|create-implicit-container).
The default is: create-implicit-container

EXAMPLES

  1. Given this layout

    h_tiles
    ├── window 1 (focused)
    └── window 2

    move right will result in the following layout

    h_tiles
    ├── window 2
    └── window 1 (focused)
  2. Given this layout

    h_tiles
    ├── window 1
    ├── window 2 (focused)
    └── v_tiles
        ├── window 3
        └── window 4

    move right will result in the following layout

    h_tiles
    ├── window 1
    └── v_tiles
        ├── window 3
        ├── window 2 (focused)
        └── window 4
  3. Given this layout

    h_tiles
    ├── window 1
    └── v_tiles
        ├── window 3
        ├── window 2 (focused)
        └── window 4

    move left will result in the following layout

    h_tiles
    ├── window 1
    ├── window 2 (focused)
    └── v_tiles
        ├── window 3
        └── window 4
  4. Implicit container example

    In some cases, move needs to implicitly create a container to fulfill your command.

    Given this layout

    h_tiles
    ├── window 1
    ├── window 2 (focused)
    └── window 3

    move up will result in the following layout

    v_tiles
    ├── window 2 (focused)
    └── h_tiles
        ├── window 1
        └── window 3

    v_tiles is an implicitly created container.

    Remark: If --boundaries is set to all-monitors-outer-frame and there is a monitor in the up direction, the implicit container is not created. Instead, window 2 is moved to the monitor above the current one.

18. move-mouse

move-mouse [-h|--help] [--fail-if-noop] <mouse-position>

Move mouse to the requested position

OPTIONS

-h, --help

Print help

--fail-if-noop

Exit with non-zero exit code if mouse is already at the requested position. The flag is compatible only with window-lazy-center and monitor-lazy-center arguments.

ARGUMENTS

<mouse-position>

Position to move mouse to. Possible values:

  • monitor-lazy-center. Move mouse to the center of the focused monitor, unless it is already within the monitor boundaries.

  • monitor-force-center. Move mouse to the center of the focused monitor.

  • window-lazy-center. Move mouse to the center of the focused window, unless it is already within the window boundaries.

  • window-force-center. Move mouse to the center of the focused window.

When no window is focused, which is the case on an empty workspace, both window-* values fall back to the focused monitor. Centering on "the focused window" has no meaning there, and the alternative is leaving the pointer on the monitor you switched away from. This matters most in on-focused-workspace-changed, where a callback is a list of commands and cannot express the shell fallback below.

EXAMPLES

  • Move mouse to the center of the focused window, falling back to the monitor when a workspace is empty (the fallback is built in; no || needed):
    aerospork move-mouse window-lazy-center

19. move-node-to-monitor

move-node-to-monitor [-h|--help] [--window-id <window-id>] [--focus-follows-window]
                     [--wrap-around] (left|down|up|right|next|prev)
move-node-to-monitor [-h|--help] [--window-id <window-id>] [--focus-follows-window]
                     [--fail-if-noop] <monitor-pattern>...

Move window to monitor targeted by relative direction, by order, or by pattern

OPTIONS

-h, --help

Print help

--wrap-around

Make it possible to wrap around the movement

--focus-follows-window

Make sure that the window in question receives focus after moving. This flag is a shortcut for manually running aerospork-workspace/aerospork-focus after move-node-to-monitor successful execution.

--fail-if-noop

Exit with a non-zero exit code if the window already belongs to the target monitor

--window-id <window-id>

Act on the specified window instead of the focused window

ARGUMENTS

(left|down|up|right)

Move window to monitor in direction relative to the focused monitor

(next|prev)

Move window to next|prev monitor in the order they appear in the menu bar icon

<monitor-pattern>…​

Find the first matching monitor and move the window there. Multiple monitor patterns are useful for covering different monitor configurations. Monitor patterns follow the same format as in the [monitors] config section (previously workspace-to-monitor-force-assignment, still accepted)

20. move-node-to-workspace

move-node-to-workspace [-h|--help] [--focus-follows-window] [--wrap-around]
                       (next|prev)
move-node-to-workspace [-h|--help] [--focus-follows-window] [--fail-if-noop]
                       [--window-id <window-id>] <workspace-name>

Move the focused window to the specified workspace

(next|prev) is identical to workspace (next|prev)

OPTIONS

-h, --help

Print help

--wrap-around

Make it possible to jump between first and last workspaces using (next|prev)

--fail-if-noop

Exit with a non-zero exit code if the window already belongs to the target workspace

--focus-follows-window

Make sure that the window in question receives focus after moving. This flag is a shortcut for manually running aerospork-workspace/aerospork-focus after move-node-to-workspace successful execution.

--window-id <window-id>

Act on the specified window instead of the focused window

ARGUMENTS

(next|prev)

Move window to next or prev workspace

<workspace-name>

Specifies workspace name where to move window to

21. move-workspace-to-monitor

move-workspace-to-monitor [-h|--help] [--workspace <workspace>] [--wrap-around] (left|down|up|right)
move-workspace-to-monitor [-h|--help] [--workspace <workspace>] [--wrap-around] (next|prev)
move-workspace-to-monitor [-h|--help] [--workspace <workspace>] <monitor-pattern>...

Move workspace to monitor targeted by relative direction, by order, or by pattern. Focus follows the workspace, so the workspace stays focused.

Deprecated name: move-workspace-to-display

The command fails for a workspace that has a monitor force assignment.

OPTIONS

-h, --help

Print help

--wrap-around

Make it possible to move a workspace between the first and last monitors

--workspace <workspace>

Act on the specified workspace instead of the focused workspace

ARGUMENTS

(left|down|up|right)

Move workspace to monitor in direction relative to the focused monitor

(next|prev)

Move the workspace to next or prev monitor. 'next' or 'prev' monitor is calculated relative to the monitor <workspace> currently belongs to.

<monitor-pattern>

Find the first matching monitor and move the workspace there. Multiple monitor patterns are useful for covering different monitor configurations. Monitor patterns follow the same format as in the [monitors] config section (previously workspace-to-monitor-force-assignment, still accepted)

22. open-settings

open-settings [-h|--help]

Open the settings window

Equivalent to choosing Settings… from the menu bar icon, pressing kbd:[Cmd+,] while AeroSpork is frontmost, or opening AeroSpork again (from Finder, Spotlight or open -a AeroSpork) while it is running. The settings window is a singleton: running this while it is already open brings the existing window to the front. The window comes to the front even when another app is frontmost, and AeroSpork never tiles it or moves it to a workspace.

The command is allowed in config, so it can be bound to a key:

[keys]
alt-shift-comma = 'open-settings'

The window has seven panes: General, Gaps, Keys, Monitors, Events, Window Rules, and Raw TOML. It is resizable (opens at 880×620, minimum 780×520) and remembers its selected pane.

Structured settings apply live as you change them, and a change still pending when you close the window is saved. The Raw TOML pane is the exception: it applies explicitly, so half-typed TOML is never written. Raw TOML supports native Find, line numbers, section jumps, and parser errors that link to the failing line.

A complex badge marks a value richer than the structured controls can edit. Such a value is preserved on save, and can be edited in Raw TOML.

OPTIONS

-h, --help

Print help

23. reload-config

reload-config [-h|--help] [--no-gui] [--dry-run]

Reload currently active config

If the config contains errors, they are printed to stdout and the GUI opens to show them.

OPTIONS

-h, --help

Print help

--no-gui

Don’t open the GUI. Report errors on stdout only

--dry-run

Validate the config and show errors (if any) but don’t reload the config

EXIT CODE

0

Success. The config is reloaded successfully.

non-zero exit code

Failure. The config contains errors.

24. resize

resize [-h|--help] [--window-id <window-id>] (smart|smart-opposite|width|height) [+|-]<number>

Resize the focused window

The first argument chooses the dimension to resize

  • width changes width

  • height changes height

  • smart changes width if the parent has horizontal orientation, and height if the parent has vertical orientation

  • smart-opposite resizes the opposite axis to smart

The second argument controls how much the size changes

  • If the <number> is prefixed with + then the dimension is increased

  • If the <number> is prefixed with - then the dimension is decreased

  • If the <number> is prefixed with neither + nor - then the command changes the absolute value of the dimension

resize on a floating window is not supported yet.

OPTIONS

-h, --help

Print help

--window-id <window-id>

Act on the specified window instead of the focused window

25. split

split [-h|--help] [--window-id <window-id>] (horizontal|vertical|opposite)

split exists solely for compatibility with i3. Prefer join-with unless you have a specific reason not to.

If the parent of focused window contains more than one child, then the command

  1. Creates a new tiling container

  2. Replaces the focused window with the container

  3. Puts the focused window into the container as its only child

The argument sets the orientation of the newly created container. opposite means the opposite orientation to the parent container.

If the parent of the focused window contains only a single child (the window itself), split changes the orientation of the parent container

Important
split has no effect if enable-normalization-flatten-containers is turned on. Use join-with to keep enable-normalization-flatten-containers enabled

OPTIONS

-h, --help

Print help

--window-id <window-id>

Act on the specified window instead of the focused window

26. summon-workspace

summon-workspace [-h|--help] [--fail-if-noop] <workspace>

Move the requested workspace to the focused monitor. The moved workspace becomes focused. The behavior is identical to Xmonad’s.

The command is only meaningful in a multi-monitor setup. On a single monitor it is identical to workspace.

OPTIONS

-h, --help

Print help

--fail-if-noop

Exit with a non-zero exit code if the workspace is already visible on the focused monitor

ARGUMENTS

<workspace>

The workspace to operate on.

27. trigger-binding

trigger-binding [-h|--help] <binding> --mode <mode-id>

Trigger AeroSpork binding as if it was pressed by user

Inspect the available bindings with aerospork config:
aerospork config --get mode.main.binding --keys

OPTIONS

-h, --help

Print help

--mode <mode-id>

Mode to search <binding> in

ARGUMENTS

<binding>

Binding to trigger

EXAMPLES

  • Run the alphabetically first binding in the config:
    aerospork trigger-binding --mode main "$(aerospork config --get mode.main.binding --keys | head -1)"

  • Trigger alt-tab binding:
    aerospork trigger-binding --mode main alt-tab

28. volume

volume [-h|--help] (up|down)
volume [-h|--help] (mute-toggle|mute-off|mute-on)
volume [-h|--help] set <number>

Manipulate volume

OPTIONS

-h, --help

Print help

ARGUMENTS

(up|down)

Increase or decrease the volume by one step (6.25%, i.e. 1/16, the same step the media keys use)

(mute-toggle|mute-on|mute-off)

Toggle/On/Off mute

set <number>

Set volume to the exact value on scale from 0 to 100

29. workspace

workspace [-h|--help] [--auto-back-and-forth] [--fail-if-noop] <workspace-name>
workspace [-h|--help] [--wrap-around] (next|prev)

1. <workspace-name> syntax

Focus the specified workspace

2. (next|prev) syntax

Focuses next or previous workspace in the list.

  • If stdin is not TTY and stdin contains non whitespace characters then the list is taken from stdin

  • Otherwise, the list is defined as all workspaces on focused monitor in alphabetical order, including empty workspaces the config declares

Workspace lifecycle

A workspace the config declares always exists, even while it is empty: every name in workspaces, every name in persistent-workspaces, and every workspace pinned to a monitor. aerospork list-workspaces --all, the menu bar and workspace next/prev show all of them.

Any other workspace, such as one that only a keybinding of your own mentions, is created the first time you switch to it and released once it is empty and no longer visible. It costs nothing until you use it: switching back recreates it indistinguishably, because an empty workspace is nothing but its name.

OPTIONS

-h, --help

Print help

--wrap-around

Make it possible to jump between first and last workspaces using (next|prev)

--auto-back-and-forth

Automatic back-and-forth when switching to already focused workspace. Incompatible with --fail-if-noop

--fail-if-noop

Exit with a non-zero exit code if the target workspace is already focused. Incompatible with --auto-back-and-forth

EXAMPLES

  • Go to the next non empty workspace on the focused monitor:
    aerospork list-workspaces --monitor focused --empty no | aerospork workspace next

30. workspace-back-and-forth

workspace-back-and-forth [-h|--help]

Switch between the focused workspace and previously focused workspace back and forth

Unlike focus-back-and-forth, workspace-back-and-forth always succeeds. Because unlike windows, workspaces can not be "closed". Workspaces are name-addressable objects. They are created and destroyed on the fly.

OPTIONS

-h, --help

Print help

31. Query commands

Query commands examine the current state without changing it.

  • Query commands are NOT available in config
    (because there is no way to consume the stdout of these commands in config)

  • Query commands are only available in CLI

  • list-exec-env-vars is the one exception: it is also available in config, so callbacks can inspect the environment their commands run with

31.1. config

config [-h|--help] --get <name> [--json] [--keys]
config [-h|--help] --major-keys
config [-h|--help] --all-keys
config [-h|--help] --config-path

Query AeroSpork config options

Internally the config is a recursive structure of maps, arrays, strings and integers. What you query is the effective config: what AeroSpork is running right now, after the config file has been desugared. So --get mode.main.binding lists the generated bindings as well as the ones you wrote.

Printing without --json or --keys flag is supported only for scalar types (strings and integers) and array of scalar types. Printing other complicated objects requires --json or --keys flag.

OPTIONS

-h, --help

Print help

--get <name>

Get the value for a given key. You can inspect available keys with --major-keys or --all-keys

--major-keys

Print major keys

--all-keys

Print all available keys recursively

--json

Print result in JSON format

--keys

Print keys of the complicated object (map or array)

--config-path

Print absolute path to the loaded config

EXAMPLES

  • List all binding modes:

    $ aerospork config --get mode --keys
    main
    service
  • List all key bindings for 'main' binding mode:

    $ aerospork config --get mode.main.binding --keys
    alt-1
    alt-2
    ...
  • List all key bindings for 'main' binding mode in JSON format:

    $ aerospork config --get mode.main.binding --json
    {
      "alt-w" : "workspace W",
      "alt-y" : "workspace Y",
      "alt-n" : "workspace N",
      "alt-shift-e" : "move-node-to-workspace E",
      "alt-shift-m" : "move-node-to-workspace M",
      "alt-shift-t" : "move-node-to-workspace T",
    ...

32. The config file

~/.aerospork.toml or ${XDG_CONFIG_HOME}/aerospork/aerospork.toml (XDG_CONFIG_HOME falls back to ~/.config when the variable is not set); a debug build uses ~/.aerospork-debug.toml. If a config is found in more than one location, the ambiguity is reported. A complete config:

mod = "alt"              # base modifier for the generated bindings
workspaces = "1-9"       # always exist; a range, a list (["dev", "web"]), or both

[gaps]
inner = 8
outer = 8                # or { top = 32, bottom = 8, left = 8, right = 8 }

[keys]                   # only what you want beyond the generated defaults
alt-shift-semicolon = "mode service"

[keys.service]           # a named mode; enter with `mode service`, leave with `mode main`
esc = ["reload-config", "mode main"]

[monitors]               # workspace -> monitor
2 = { uuid = "AAAAAAAA-0000-4000-8000-000000000001" }

[on-window]              # app id -> what to do when its window appears
"com.apple.mail" = "move-node-to-workspace 3"

32.1. Generated bindings

mod generates mod-h/j/k/l (focus), mod-shift-h/j/k/l (move), mod-minus/mod-equal (resize), mod-slash/mod-comma (layout) and mod-tab (previous workspace). Each entry in workspaces additionally generates mod-<key> to switch to it and mod-shift-<key> to move the focused window there, where <key> is the first character of the name, lower-cased. Every entry also always exists, even while empty, with or without mod. persistent-workspaces declares workspaces the same way without generating any binding. aerospork config --get persistent-workspaces lists every declared workspace: those in workspaces and persistent-workspaces, and those pinned to a monitor.

Anything in [keys] overrides a generated binding with the same key, so any generated default can be replaced. Remove mod and nothing is generated at all.

32.2. Older configs

A config written in the previous schema (the one with [mode.main.binding] and workspace-to-monitor-force-assignment) is converted on first launch, and the original is kept next to it as <name>.pre-v2. The conversion is only performed when the converted file provably loads to the same configuration; otherwise your file is left exactly as it is.

[mode.<name>.binding], workspace-to-monitor-force-assignment, and the per-edge gaps spelling all still parse, so a hand-written or GUI-edited mixture keeps working.

32.3. debug-windows

debug-windows [-h|--help] [--window-id <window-id>]

Interactive command to record Accessibility API debug information to create bug reports

Attach the output to a bug report about incorrect window handling, such as a window being floated when it shouldn’t be.

The intended usage:

  1. Run the command to start recording a debug session

  2. Focus the problematic window, or make the window appear

  3. Run the command again to stop recording and print the results

debug-windows is not a stable API. Don’t rely on the command existing or on its output format. Its only intended use is reporting bugs about incorrect window handling.

OPTIONS

-h, --help

Print help

--window-id <window-id>

Print debug information of the specified window right away. Usage of this flag disables interactive mode.

32.4. list-apps

list-apps [-h|--help] [--macos-native-hidden [no]] [--format <output-format>] [--count] [--json]

Print the list of running applications that appears in the Dock and may have a user interface

Use it to find the application IDs for an on-window-detected callback

OPTIONS

-h, --help

Print help

--macos-native-hidden [no]

Filter results to only print hidden applications. [no] inverts the condition

--format <output-format>

Specify output format. See "Output Format" section for more details. Incompatible with --count

--count

Output only the number of apps. Incompatible with: --format, --json

--json

Output in JSON format. Can be used in combination with --format to specify which data to include into the json. With --json, the <output-format> may contain only interpolation variables and spaces (%{right-padding} and literal text are rejected). Incompatible with --count

OUTPUT FORMAT

The output format is set with the optional [--format <output-format>] option. <output-format> supports string interpolation.

If not specified, the default <output-format> is:
%{app-pid}%{right-padding} | %{app-bundle-id}%{right-padding} | %{app-name}

The following variables can be used inside <output-format>:

%{app-bundle-id}

String. Application unique identifier. Bundle ID

%{app-name}

String. Application name

%{app-pid}

Number. UNIX process identifier

%{app-exec-path}

String. Application executable path

%{app-bundle-path}

String. Application bundle path

%{right-padding}

Expands to the minimum number of spaces required to right-pad the current column

%{newline}

Unicode U+000A newline symbol \n

%{tab}

Unicode U+0009 tab symbol \t

32.5. list-exec-env-vars

list-exec-env-vars [-h|--help] [--show-secrets]

List environment variables that exec-* commands and callbacks are run with

Examples of commands and callbacks:

  • aerospork exec-and-forget command

  • the on-focus-changed / on-focused-workspace-changed / on-focused-monitor-changed callbacks

Values are redacted by default for variables whose names look like secrets (matching KEY, TOKEN, SECRET, PASSWORD, PASSWD, CREDENTIAL, AUTH or PRIVATE). The match is deliberately over-eager, because the two failure directions are not symmetric: a needlessly hidden value costs you one flag, a leaked credential costs you the credential.

Redaction is a shoulder-surfing guard for display only. The child process still receives the real environment, because a script that posts to Slack needs its token. See man aerospork-exec-and-forget.

It lists the environment every such command starts from. The variables AeroSpork adds per command — AEROSPORK_WINDOW_ID, AEROSPORK_WORKSPACE, AEROSPORK_FOCUSED_WORKSPACE, AEROSPORK_PREV_WORKSPACE — depend on what triggered it, so they cannot appear here.

OPTIONS

-h, --help

Print help

--show-secrets

Print real values instead of <redacted>

32.6. list-modes

list-modes [-h|--help] [--current]

Print a list of modes currently specified in the configuration

See the guide for documentation about binding modes

OPTIONS

-h, --help

Print help

--current

Only print the currently active mode

32.7. list-monitors

list-monitors [-h|--help] [--focused [no]] [--mouse [no]] [--format <output-format>] [--count] [--json]

Print monitors that satisfy conditions

OPTIONS

-h, --help

Print help

--focused [no]

Filter results to only print the focused monitor. [no] inverts the condition

--mouse [no]

Filter results to only print the monitor with the mouse. [no] inverts the condition

--format <output-format>

Specify output format. See "Output Format" section for more details. Incompatible with --count

--count

Output only the number of monitors. Incompatible with: --format, --json

--json

Output in JSON format. Can be used in combination with --format to specify which data to include into the json. With --json, the <output-format> may contain only interpolation variables and spaces (%{right-padding} and literal text are rejected). Incompatible with --count

OUTPUT FORMAT

The output format is set with the optional [--format <output-format>] option. <output-format> supports string interpolation.

If not specified, the default <output-format> is:
%{monitor-id}%{right-padding} | %{monitor-name}

The following variables can be used inside <output-format>:

%{monitor-id}

1-based Number. Sequential number of the belonging monitor

%{monitor-appkit-nsscreen-screens-id}

1-based Number. Index of the belonging monitor in the NSScreen.screens array. Useful for integration with other tools that use NSScreen.screens ordering (like sketchybar).

%{monitor-name}

String. Name of the belonging monitor

%{monitor-fingerprint}

String. Hardware fingerprint of the monitor: whichever of vendor, model, serial, name, resolution and UUID the display reports. Use it to identify a specific physical monitor in a docking setup.

%{monitor-vendor-id}

String. Vendor ID of the monitor in hexadecimal format (e.g., 0x10AC). Empty if not available.

%{monitor-model-id}

String. Model ID of the monitor in hexadecimal format (e.g., 0xD0C1). Empty if not available.

%{monitor-serial-number}

String. Serial number of the monitor. Empty if not available.

%{monitor-width}

Number. Width of the monitor in points

%{monitor-height}

Number. Height of the monitor in points

%{right-padding}

Expands to the minimum number of spaces required to right-pad the current column

%{newline}

Unicode U+000A newline symbol \n

%{tab}

Unicode U+0009 tab symbol \t

EXAMPLES

  • Print all monitors in the default format:
    aerospork list-monitors

  • Print monitor fingerprints, to paste into the [monitors] config section:
    aerospork list-monitors --format "%{monitor-fingerprint}"

  • Print monitors with their vendor/model IDs and size:
    aerospork list-monitors --format "%{monitor-name} [%{monitor-vendor-id}:%{monitor-model-id}] %{monitor-width}x%{monitor-height}"

32.8. list-windows

list-windows [-h|--help] (--workspace <workspace>...|--monitor <monitor>...)
             [--monitor <monitor>...] [--workspace <workspace>...]
             [--pid <pid>] [--app-bundle-id <app-bundle-id>] [--format <output-format>]
             [--count] [--json]
list-windows [-h|--help] --all [--format <output-format>] [--count] [--json]
list-windows [-h|--help] --focused [--format <output-format>] [--count] [--json]

Print windows that satisfy conditions

OPTIONS

-h, --help

Print help

--all

Alias for --monitor all. Use it only when you genuinely need workspaces/windows from all monitors.

In a multi-monitor setup --monitor focused is almost always the option you want. A script that operates on all monitors will act on workspaces and windows you were not looking at.

--focused

Print the focused window. If no window is focused, an error is reported.

--workspace <workspace>…​

Filter results to only print windows that belong to either of specified workspaces. <workspace>…​ is a space-separated list of workspace names.

Possible values:

  1. Workspace name

  2. focused is a special workspace name that represents the focused workspace

  3. visible is a special workspace name that represents all currently visible workspaces (In multi-monitor setup, there are multiple visible workspaces)

--monitor <monitors>

Filter results to only print workspaces/windows that are attached to specified monitors. <monitors> is a space-separated list of monitor IDs.

Possible monitor IDs:

  1. 1-based index of a monitor, as if monitors were ordered horizontally from left to right

  2. all is a special monitor ID that represents all monitors

  3. mouse is a special monitor ID that represents the monitor with the mouse

  4. focused is a special monitor ID that represents the focused monitor

--pid <pid>

Filter results to only print windows that belong to the Application with specified <pid>

--app-bundle-id <app-bundle-id>

Filter results to only print windows that belong to the Application with specified Bundle ID

Deprecated (but still supported) flag name: --app-id

--format <output-format>

Specify output format. See "Output Format" section for more details. Incompatible with --count

--count

Output only the number of windows. Incompatible with: --format, --json

--json

Output in JSON format. Can be used in combination with --format to specify which data to include into the json. With --json, the <output-format> may contain only interpolation variables and spaces (%{right-padding} and literal text are rejected). Incompatible with --count

OUTPUT FORMAT

The output format is set with the optional [--format <output-format>] option. <output-format> supports string interpolation.

If not specified, the default <output-format> is:
%{window-id}%{right-padding} | %{app-name}%{right-padding} | %{window-title}

The following variables can be used inside <output-format>:

%{window-id}

Number. Window unique ID

%{window-title}

String. Window title

%{window-is-fullscreen}

Boolean. Is window in fullscreen by aerospork fullscreen command

%{app-bundle-id}

String. Application unique identifier. Bundle ID

%{app-name}

String. Application name

%{app-pid}

Number. UNIX process identifier

%{app-exec-path}

String. Application executable path

%{app-bundle-path}

String. Application bundle path

%{workspace}

String. Name of the belonging workspace

%{workspace-is-focused}

Boolean. True if the workspace has focus

%{workspace-is-visible}

Boolean. True if the workspace is visible. A workspace can be visible but not focused in a multi-monitor setup

%{monitor-id}

1-based Number. Sequential number of the belonging monitor

%{monitor-appkit-nsscreen-screens-id}

1-based Number. Index of the belonging monitor in the NSScreen.screens array. Useful for integration with other tools that use NSScreen.screens ordering (like sketchybar).

%{monitor-name}

String. Name of the belonging monitor

%{monitor-fingerprint}

String. Hardware fingerprint of the monitor: whichever of vendor, model, serial, name, resolution and UUID the display reports. Use it to identify a specific physical monitor in a docking setup.

%{monitor-vendor-id}

String. Vendor ID of the monitor in hexadecimal format (e.g., 0x10AC). Empty if not available.

%{monitor-model-id}

String. Model ID of the monitor in hexadecimal format (e.g., 0xD0C1). Empty if not available.

%{monitor-serial-number}

String. Serial number of the monitor. Empty if not available.

%{monitor-width}

Number. Width of the monitor in points

%{monitor-height}

Number. Height of the monitor in points

%{right-padding}

Expands to the minimum number of spaces required to right-pad the current column

%{newline}

Unicode U+000A newline symbol \n

%{tab}

Unicode U+0009 tab symbol \t

32.9. list-workspaces

list-workspaces [-h|--help] --monitor <monitor>... [--visible [no]] [--empty [no]] [--format <output-format>] [--count] [--json]
list-workspaces [-h|--help] --all [--format <output-format>] [--count] [--json]
list-workspaces [-h|--help] --focused [--format <output-format>] [--count] [--json]

Print workspaces that satisfy conditions

OPTIONS

-h, --help

Print help

--all

Alias for --monitor all. Use it only when you genuinely need workspaces/windows from all monitors.

In a multi-monitor setup --monitor focused is almost always the option you want. A script that operates on all monitors will act on workspaces and windows you were not looking at.

--focused

Alias for --monitor focused --visible. Always prints a single workspace

--monitor <monitors>

Filter results to only print workspaces/windows that are attached to specified monitors. <monitors> is a space-separated list of monitor IDs.

Possible monitor IDs:

  1. 1-based index of a monitor, as if monitors were ordered horizontally from left to right

  2. all is a special monitor ID that represents all monitors

  3. mouse is a special monitor ID that represents the monitor with the mouse

  4. focused is a special monitor ID that represents the focused monitor

--visible [no]

Filter results to only print currently visible workspaces. [no] inverts the condition. Several workspaces can be visible in multi-monitor setup

--empty [no]

Filter results to only print empty workspaces. [no] inverts the condition.

--format <output-format>

Specify output format. See "Output Format" section for more details. Incompatible with --count

--count

Output only the number of workspaces. Incompatible with: --format, --json

--json

Output in JSON format. Can be used in combination with --format to specify which data to include into the json. With --json, the <output-format> may contain only interpolation variables and spaces (%{right-padding} and literal text are rejected). Incompatible with --count

OUTPUT FORMAT

The output format is set with the optional [--format <output-format>] option. <output-format> supports string interpolation.

If not specified, the default <output-format> is:
%{workspace}

The following variables can be used inside <output-format>:

%{workspace}

String. Name of the belonging workspace

%{workspace-is-focused}

Boolean. True if the workspace has focus

%{workspace-is-visible}

Boolean. True if the workspace is visible. A workspace can be visible but not focused in a multi-monitor setup

%{monitor-id}

1-based Number. Sequential number of the belonging monitor

%{monitor-appkit-nsscreen-screens-id}

1-based Number. Index of the belonging monitor in the NSScreen.screens array. Useful for integration with other tools that use NSScreen.screens ordering (like sketchybar).

%{monitor-name}

String. Name of the belonging monitor

%{monitor-fingerprint}

String. Hardware fingerprint of the monitor: whichever of vendor, model, serial, name, resolution and UUID the display reports. Use it to identify a specific physical monitor in a docking setup.

%{monitor-vendor-id}

String. Vendor ID of the monitor in hexadecimal format (e.g., 0x10AC). Empty if not available.

%{monitor-model-id}

String. Model ID of the monitor in hexadecimal format (e.g., 0xD0C1). Empty if not available.

%{monitor-serial-number}

String. Serial number of the monitor. Empty if not available.

%{monitor-width}

Number. Width of the monitor in points

%{monitor-height}

Number. Height of the monitor in points

%{right-padding}

Expands to the minimum number of spaces required to right-pad the current column

%{newline}

Unicode U+000A newline symbol \n

%{tab}

Unicode U+0009 tab symbol \t