Skip to content

Configuration overview

You will learn

  • How to set gaps between windows
  • How to choose and enable layouts
  • How to exclude apps from tiling
  • How validation catches configuration errors

Shoji uses a single configure method that accepts a table of options. All options have sensible defaults, so you can start simple and add configuration as you discover what works for your workflow.

This page is the single source of truth for all options. The linked pages provide examples and rationale, not additional settings.

At a glance

  • Defaults favor no gaps and the tall layout
  • main_ratio range: 0.1 to 0.9; nmaster minimum: 1
  • strict_validation is true and rejects invalid values
  • Use the tables below for every available option

Basic setup

hs.loadSpoon("Shoji")
spoon.Shoji:configure({
gap_outer = 0,
gap_inner = 0,
default_layout = "tall",
enabled_layouts = { "tall", "wide", "fullscreen", "bsp" },
})
spoon.Shoji:start()

Configuration reference

The tables below list every available option. Links after each section point to examples and rationale.

Spacing

OptionTypeDefaultDescription
gap_outernumber0Gap around screen edges (pixels)
gap_innernumber0Gap between windows (pixels)

For examples and visual diagrams, see Gaps.

Layouts

OptionTypeDefaultDescription
default_layoutstring"tall"Layout for new macOS Spaces
enabled_layoutsstring[]tall, wide, fullscreen, bspLayouts in cycle order
main_rationumber0.5Main area ratio (0.1-0.9)
nmasternumber1Number of master windows
layoutsLayout[]nilCustom layouts to register
retile_on_focusbooleanfalseRetile when focus changes

Default enabled layouts: {"tall", "wide", "fullscreen", "bsp"}.

For layout examples and guidance, see Layouts.

Window filtering

OptionTypeDefaultDescription
filter_modestring"blocklist""blocklist" or "allowlist"
filter_appsstring[]{}App bundle IDs to filter
min_widthnumber0Minimum window width to tile
min_heightnumber0Minimum window height to tile

For filtering examples and bundle ID guidance, see Window filtering.

Alerts

OptionTypeDefaultDescription
show_layout_alertsbooleantrueShow alerts on layout change
show_layout_iconbooleantrueShow layout icon in alerts
alert_durationnumber0.5Alert duration (seconds)

For alert behavior and customization examples, see Alerts.

Cheatsheet

OptionTypeDefaultDescription
cheatsheet_stylestring"system""light", "dark", or "system"
cheatsheet_opacitynumber1.0Background opacity (0.1-1.0)
cheatsheet_fontstring"Menlo"Font for shortcut keys
cheatsheet_show_unboundbooleantrueShow unbound actions

For cheatsheet usage and keybinding customization, see Default keybindings.

Drag-to-swap

OptionTypeDefaultDescription
drag_swapbooleanfalseEnable drag-to-swap
drag_min_distancenumber40Minimum drag distance (pixels)
drag_swap_sensitivitynumber0Swap sensitivity (0-1)
drag_enabled_layoutsstring[]{"tall"}Drag-swap layouts

For drag-to-swap behavior and examples, see Drag-to-swap.

Hooks

OptionTypeDefaultDescription
hookstablenilEvent callbacks

For hook names and arguments, see Hooks reference.

Validation

OptionTypeDefaultDescription
strict_validationbooleantrueFail on invalid config

Validation

Shoji validates your configuration on startup to catch mistakes early. If something is wrong, you will see a clear error message:

spoon.Shoji:configure({
gap_outer = -5, -- Invalid: minimum is 0
main_ratio = 1.5, -- Invalid: maximum is 0.9
})
-- Error: gap_outer: must be >= 0, got -5

Permissive validation

Set strict_validation = false to fall back to defaults instead of failing:

spoon.Shoji:configure({
strict_validation = false,
gap_outer = -5, -- Falls back to 0
})

Unknown keys

Shoji also warns about typos and unknown keys, which helps catch common mistakes:

spoon.Shoji:configure({
gap = 10, -- Typo: should be gap_outer or gap_inner
})
-- Warning: Unknown config key(s): 'gap'. Valid keys: ...