Commands

Key bindings, dinky <command> and the menu share one vocabulary. dinky help prints it.

Command  
workspace <n\|prev\|next> Show a workspace and focus its display. prev/next step through the focused display’s and don’t wrap.
workspace-back-and-forth Switch to the previous workspace.
move-window-to-workspace <n\|prev\|next> [--follow] Move the focused window, and with --follow go too.
move-window-to-display <next\|prev> [--follow] Move the focused window to another display’s workspace.
focus <left\|down\|up\|right> [--boundaries <b>] [--boundaries-action <a>] Focus the nearest window. --boundaries all-monitors-outer-frame continues onto the next display. --boundaries-action is stop, fail, wrap-around-the-workspace (--wrap-around) or wrap-around-all-monitors.
focus-monitor <left\|down\|up\|right\|next\|prev\|n> Focus a display.
move <left\|down\|up\|right> Move the focused window in the tree.
join-with <left\|down\|up\|right> Put the focused window and its neighbour in a new container.
resize <smart\|width\|height> <+n\|-n> Resize by n points.
layout <tiles\|accordion\|horizontal\|vertical\|auto\|h_tiles\|v_tiles\|h_accordion\|v_accordion\|floating\|tiling>... Set the container’s layout, or float/tile the window. Given several, applies the first that isn’t current, so layout floating tiling toggles.
fullscreen Toggle filling the workspace (not macOS full screen).
flatten-workspace-tree Put every window back in one container.
balance-sizes Give every window an equal share.
retile Re-read windows and re-apply every layout.
mode <name> Switch binding mode.
reload-config Reload the config.
enable <on\|off\|toggle> Turn dinky on or off. Off restores windows.
list-workspaces, list-windows, list-monitors See Scripting. list-displays = list-monitors.
debug-state Tiling state as JSON, for bug reports.
exec-and-forget <shell command> Run with /bin/sh -c without waiting. Output goes to the log.

Workspaces are numbered across displays; see [workspace-to-display]. A full-screen app’s Space has no number, nor does the Space of a display without workspaces.

Command line

The app binary is the CLI. dinky <command> sends a command to the running app and exits 1 on errors or when it isn’t running. CLI-only commands:

Command  
app Run the app in the foreground, logging to the terminal.
doctor [--config <path>] Check the config and macOS settings.
recover Restore windows left tiled by a crash.
debug events\|windows Print window events or windows, without the app.

The log is ~/Library/Logs/dinky.log; attach it to bug reports.

Scripts can skip the CLI and talk to the socket: one command per connection, answered with ok or error and the reply.

printf 'workspace 2\n' | nc -U "$TMPDIR/dinky.sock"

Recovery

dinky journals each window’s original frame and Space before tiling it. enable off, quitting, kill and logging out put them all back. After a crash, the menu offers to restore them (or dinky recover); dinky stays off until dinky enable on.

Scripting

The queries follow AeroSpace’s names, flags and output, so most AeroSpace bar scripts work by swapping the command name.

Query Flags Default format
list-workspaces --all, --focused, --monitor <focused\|all\|n>..., --visible [no], --empty [no], --format %{workspace}
list-windows --all, --focused, --monitor <focused\|all\|n>..., --workspace <focused\|visible\|n>..., --app-bundle-id <id>, --format %{window-id}%{right-padding} \| %{app-name}%{right-padding} \| %{window-title}
list-monitors --focused [no], --format %{monitor-id}%{right-padding} \| %{monitor-name}

Without a display flag, queries cover the focused display. Format variables:

%{monitor-is-main} tells a bar which workspaces are on the side display.

SketchyBar

Drive a bar from the config’s hooks:

[hooks]
startup = ['exec-and-forget brew services restart sketchybar']
workspace-changing = ['exec-and-forget sketchybar --trigger workspace_changing DINKY_DISPLAY=$DINKY_DISPLAY DINKY_WORKSPACE=$DINKY_WORKSPACE']
workspace-changed = ['exec-and-forget sketchybar --trigger workspace_change WORKSPACE=$DINKY_WORKSPACE']
focus-changed = ['exec-and-forget sketchybar --trigger focus_changed']

The workspace hooks set DINKY_WORKSPACE (empty on a full-screen Space), DINKY_PREV_WORKSPACE and DINKY_DISPLAY (1-based). workspace-changing fires only for dinky’s own switches, so draw the target there and the real state on workspace-changed, which always follows. exec-and-forget has Homebrew on PATH.