Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Layouts

The layout engine is one function: layout(windows, rect, params) → geometries. Every algorithm implements the TilingLayout trait and is stateless; the state lives in the workspace’s LayoutParams.

The five algorithms

Cycle per workspace with Mod+]; reset with Mod+[.

AlgorithmArrangement
master-stack (default)Master area on the left, stack on the right. Adjustable master count, ratio, stack columns, and flip.
centered-masterMaster window centered, stack columns flanking both sides.
fibonacciWindows spiral inward, each taking half the remaining space.
gridEqual cells in rows and columns.
monocleOne window fills the working area; the bar stays visible.

Set the default globally or per workspace:

layout {
    default-algorithm "master-stack"
}

workspace "media" {
    layout {
        default-algorithm "monocle"
        gaps 0
    }
}

Parameters

Per workspace, adjusted live from the keyboard, remembered independently:

ParameterDefaultKeys
master-ratio0.55Mod+L grow, Mod+H shrink
master-count1Mod+, add, Mod+. remove
stack-count (stack columns)1Mod+Shift+, add, Mod+Shift+. remove
flipoffMod+\
gaps8 pxconfig only

Moving windows within a layout

  • Mod+/: swap the focused window with master.
  • Mod+Shift+J / Mod+Shift+K: swap with the next or previous window.
  • Mod+Tab: focus master. Alt+Tab / Shift+Alt+Tab: focus next or previous window (plain cycling; every window is already visible in a tiling layout, so there is no most-recently-used switcher).

Floating, fullscreen, maximize, iconify

  • Mod+F toggles floating. Floating windows render above tiles and move or resize with Mod+drag. Window rules can float an app permanently.
  • Mod+Shift+F fullscreen covers the whole output, bar included. Apps can request it themselves (F11 in a browser, double-click in mpv).
  • Mod+M maximize fills the working area and keeps the bar visible.
  • Mod+I iconifies: the window stays on its workspace but leaves the layout until Mod+Shift+I restores it. What a client’s own minimize request does is the iconify-action setting (ignore by default, iconify, or send-to-workspace <n>).

Adding an algorithm

Implement TilingLayout in src/layout/tiling/ and register it in tiling/mod.rs. No other file changes. The golden geometry snapshots in src/layout/tests/tiling_geometry.rs pin every algorithm’s exact rectangles for one to six windows; a new algorithm adds its own.