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+[.
| Algorithm | Arrangement |
|---|---|
| master-stack (default) | Master area on the left, stack on the right. Adjustable master count, ratio, stack columns, and flip. |
| centered-master | Master window centered, stack columns flanking both sides. |
| fibonacci | Windows spiral inward, each taking half the remaining space. |
| grid | Equal cells in rows and columns. |
| monocle | One 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:
| Parameter | Default | Keys |
|---|---|---|
master-ratio | 0.55 | Mod+L grow, Mod+H shrink |
master-count | 1 | Mod+, add, Mod+. remove |
stack-count (stack columns) | 1 | Mod+Shift+, add, Mod+Shift+. remove |
flip | off | Mod+\ |
gaps | 8 px | config 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+Ftoggles floating. Floating windows render above tiles and move or resize withMod+drag. Window rules can float an app permanently.Mod+Shift+Ffullscreen covers the whole output, bar included. Apps can request it themselves (F11 in a browser, double-click in mpv).Mod+Mmaximize fills the working area and keeps the bar visible.Mod+Iiconifies: the window stays on its workspace but leaves the layout untilMod+Shift+Irestores it. What a client’s own minimize request does is theiconify-actionsetting (ignoreby default,iconify, orsend-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.