# Tessera — Complete Configuration Example (tessera.yml)
#
# File locations by system:
#   Linux:   $XDG_CONFIG_HOME/tessera/tessera.yml (default: ~/.config/tessera/tessera.yml)
#   macOS:   ~/Library/Application Support/Tessera/tessera.yml
#   Windows: %APPDATA%\Tessera\tessera.yml
#
# Custom JavaScript layouts live in a `layouts/` folder next to this file.
# Unknown or platform-specific keys are preserved on save and never dropped.
# Almost every option here can also be changed in the Preferences window.

# ==============================================================================
# 1. Tiling, Margins & Screen Padding
# ==============================================================================

# Enable or pause automatic window tiling management.
# Type: boolean | Default: true
tiling-enabled: true

# Maximum number of windows to tile per workspace (0 = unlimited).
# Type: integer >= 0 | Default: 0
window-max-count: 0

# Add outer gap spacing between tiled windows.
# Type: boolean | Default: false
window-margins: false

# Apply window margins only when more than one tiled window is visible.
# Type: boolean | Default: false
smart-window-margins: false

# Gap between tiled windows in pixels (when window-margins is true).
# Type: integer >= 0 | Default: 0
window-margin-size: 0

# Minimum width/height for tiled windows in pixels (0 = disabled).
# Type: integer >= 0 | Default: 0
window-minimum-width: 0
window-minimum-height: 0

# Padding in pixels between screen edges and the tiling area.
# Type: integer >= 0 | Default: 0
screen-padding-top: 0
screen-padding-right: 0
screen-padding-bottom: 0
screen-padding-left: 0

# Skip screen padding on the built-in laptop display.
# Type: boolean | Default: false
disable-padding-on-builtin-display: false

# Ignore panels, struts, and docks during tiling calculations.
# Type: boolean | Default: false
ignore-menu-bar: false

# ==============================================================================
# 2. Window Filtering, Floating Rules & Overflow
# ==============================================================================

# Applications or window title patterns that float instead of tiling.
# Entries may be strings or rule objects (`id` and optional `window-titles`).
# Type: list | Default: []
floating: []
# Example:
# floating:
#   - "Calculator"
#   - id: "org.xfce.terminal"
#     window-titles: ["Preferences"]

# Whether `floating` acts as a blacklist (true) or whitelist (false).
# Type: boolean | Default: true
floating-is-blacklist: true

# Automatically float windows whose natural size is smaller than `small-window-size`.
# Type: boolean | Default: true
float-small-windows: true

# Size threshold in pixels for `float-small-windows` (<= 0 falls back to 500).
# Type: integer >= 0 | Default: 500
small-window-size: 500

# Ordered rules assigning newly opened windows to specific workspaces.
# Type: list | Default: []
workspace-assignments: []

# Action when tiled windows exceed maximum capacity (`window-max-count` or layout floor).
# Values: move-to-output | float | shrink-neighbors | minimize
# Default: move-to-output
overflow-policy: move-to-output

# Show a HUD alert when the overflow policy triggers.
# Type: boolean | Default: false
overflow-hud-warning: false

# ==============================================================================
# 3. Layouts & Workspaces
# ==============================================================================

# Ordered list of layouts cycled by `cycle-layout` / `cycle-layout-backward`.
# Built-in keys: tall, tall-right, wide, middle-wide, column, row, grid, bsp,
# fullscreen, floating, two-pane, two-pane-right, three-column-left,
# three-column-right, four-column-left, four-column-right, widescreen-tall,
# widescreen-tall-right. Custom JS layouts use their script filename without .js.
# Type: list of strings | Default: ["tall", "wide", "fullscreen", "column"]
layouts:
  - tall
  - wide
  - fullscreen
  - column

# Active layout key resumed on next launch (empty/omitted = first layout in `layouts`).
# Type: string | Default: ""
active-layout: ""

# Restore last-used layout assignments per output on startup.
# Type: boolean | Default: true
restore-layouts-on-launch: true

# Remember selected layout, main-pane ratio, and main-pane count per workspace.
# Type: boolean | Default: true
per-workspace-layouts: true

# Insert newly opened windows into the main pane instead of the stack.
# Type: boolean | Default: false
new-windows-to-main: false

# Persistent layout map per output connector name (written automatically).
# Type: mapping (output: layout) | Default: {}
tessera-output-layouts: {}

# Persistent layout map per global workspace index (written automatically).
# Type: mapping (workspace: layout) | Default: {}
tessera-workspace-layouts: {}

# ==============================================================================
# 4. Mouse, Focus & Window Behaviour
# ==============================================================================

# Percentage step for keyboard main-pane resize (`expand-main` / `shrink-main`).
# Type: float (1.0..=100.0) | Default: 5.0
window-resize-step: 5.0

# Move the mouse pointer to the center of a newly focused window.
# Type: boolean | Default: false
mouse-follows-focus: false

# Focus the window under the mouse pointer automatically.
# Type: boolean | Default: false
focus-follows-mouse: false

# Dragging a window onto another swaps their positions in the layout.
# Type: boolean | Default: false
mouse-swaps-windows: false

# Dragging a tiled window's border resizes its pane in the layout.
# Type: boolean | Default: false
mouse-resizes-windows: false

# Follow focus when throwing a window to another workspace.
# Type: boolean | Default: true
follow-space-thrown-windows: true

# Follow focus when moving a window to another monitor.
# Type: boolean | Default: false
follow-monitor-thrown-windows: false

# ==============================================================================
# 5. HUD, Tray, Appearance & Language
# ==============================================================================

# Show the on-screen HUD when cycling or selecting layouts.
# Type: boolean | Default: true
enables-layout-hud: true

# Show the on-screen HUD when switching workspaces.
# Type: boolean | Default: true
enables-layout-hud-on-space-change: true

# Display the managed window count inside the layout HUD.
# Type: boolean | Default: false
enables-window-count-hud: false

# How long the HUD stays on screen in milliseconds.
# Type: integer (600..=5000) | Default: 1200
hud-duration-ms: 1200

# Notification delivery channel.
# Values: system | hud | Default: system
notification-style: system

# Hide the system tray / menu-bar icon.
# Type: boolean | Default: false
hide-menu-bar-icon: false

# Window-manager title bars and borders on tiled windows.
# Values: keep | hide-tiled | Default: keep
window-decorations: keep

# Interface language (`auto` follows TESSERA_LANG, then system language, then en).
# Values: auto | en | pt-BR | es | fr | de | it | ru | zh-CN | ja | ko
# Default: auto
language: auto

# Interface toolkit/look (`auto` picks the native provider for the session).
# Values: auto | gtk | adwaita | qt | appkit | winui | Default: auto
ui-style: auto

# Log verbose layout geometry diagnostics.
# Type: boolean | Default: false
debug-layout-info: false

# ==============================================================================
# 6. AI Agents (Embedded MCP Server)
# ==============================================================================

# Enable the embedded MCP server (Linux and macOS).
# Type: boolean | Default: false
mcp-enabled: false

# Permissions granted to connected MCP clients.
# Values: read-only | control | Default: read-only
mcp-mode: read-only

# Allowlist of exposed MCP tool names (empty = all tools permitted by `mcp-mode`).
# Type: list of strings | Default: []
mcp-allowed-tools: []

# ==============================================================================
# 7. Modifier Groups (mod1..mod4)
# ==============================================================================
# Valid modifiers: option (alt), shift, control (ctrl), command (super)

mod1:
  - option
  - shift

mod2:
  - option
  - shift
  - control

# Unset by default:
# mod3: []
# mod4: []

# ==============================================================================
# 8. Keyboard Shortcuts
# ==============================================================================
# Each binding maps `{ mod: mod1..mod4, key: "<key>" }` or `false` to disable.

# --- Layouts & Tiling ---
cycle-layout:
  mod: mod1
  key: space
cycle-layout-backward:
  mod: mod2
  key: space
select-tall-layout:
  mod: mod1
  key: a
select-wide-layout:
  mod: mod1
  key: s
select-fullscreen-layout:
  mod: mod1
  key: d
select-column-layout:
  mod: mod1
  key: f
display-current-layout:
  mod: mod1
  key: i
toggle-float:
  mod: mod1
  key: t
toggle-tiling:
  mod: mod2
  key: t
enable-tiling: false
disable-tiling: false

# --- Main Pane & Window Focus / Swapping ---
shrink-main:
  mod: mod1
  key: h
expand-main:
  mod: mod1
  key: l
increase-main:
  mod: mod1
  key: ","
decrease-main:
  mod: mod1
  key: "."
focus-ccw:
  mod: mod1
  key: j
focus-cw:
  mod: mod1
  key: k
focus-main:
  mod: mod1
  key: m
swap-ccw:
  mod: mod2
  key: j
swap-cw:
  mod: mod2
  key: k
swap-main:
  mod: mod1
  key: enter

# --- Controller & Preferences ---
reevaluate-windows:
  mod: mod1
  key: z
relaunch-controller:
  mod: mod2
  key: z
toggle-focus-follows-mouse:
  mod: mod2
  key: x

# --- Screens & Monitors ---
focus-screen-ccw:
  mod: mod1
  key: p
focus-screen-cw:
  mod: mod1
  key: n
swap-screen-ccw:
  mod: mod2
  key: h
swap-screen-cw:
  mod: mod2
  key: l
focus-screen-1:
  mod: mod1
  key: w
focus-screen-2:
  mod: mod1
  key: e
focus-screen-3:
  mod: mod1
  key: r
focus-screen-4:
  mod: mod1
  key: q
focus-screen-5:
  mod: mod1
  key: g
throw-screen-1:
  mod: mod2
  key: w
throw-screen-2:
  mod: mod2
  key: e
throw-screen-3:
  mod: mod2
  key: y
throw-screen-4:
  mod: mod2
  key: q
throw-screen-5:
  mod: mod2
  key: g
swap-screen-1: false
swap-screen-2: false
swap-screen-3: false
swap-screen-4: false
swap-screen-5: false

# --- Workspaces ---
throw-space-left:
  mod: mod2
  key: b
throw-space-right:
  mod: mod2
  key: f
throw-space-1:
  mod: mod2
  key: "1"
throw-space-2:
  mod: mod2
  key: "2"
throw-space-3:
  mod: mod2
  key: "3"
throw-space-4:
  mod: mod2
  key: "4"
throw-space-5:
  mod: mod2
  key: "5"
throw-space-6:
  mod: mod2
  key: "6"
throw-space-7:
  mod: mod2
  key: "7"
throw-space-8:
  mod: mod2
  key: "8"
throw-space-9:
  mod: mod2
  key: "9"
throw-space-10:
  mod: mod2
  key: "0"
