Layout templates let you define a frame layout, including which programs to spawn into each frame, in a TOML file, then apply it with a single command or keybinding. They're useful for setting up a development workspace, a monitoring dashboard, or any repeatable multi-window arrangement.
Template files go in:
~/.config/morgenwm/templates/<name>.toml
setup.sh installs the example templates from example/templates/ into this directory. You can create your own or edit the examples.
A template is a flat list of [[frame]] entries. Each frame has an id and is either a leaf (holds windows) or a split (contains two child frames). Splits reference their children by left and right id.
| Field | Type | Applies to | Description |
|---|---|---|---|
| id | string | all | Unique identifier for this frame |
| parent | string | all | Parent split id; empty for the root |
| type | string | all | "leaf" or "split" |
| direction | string | splits | "horizontal" (left-right) or "vertical" (top-bottom) |
| ratio | float | splits | First child's share, 0.0–1.0 (default 0.5) |
| left | string | splits | Id of the left/top child |
| right | string | splits | Id of the right/bottom child |
| command | string | leaves | Shell command(s) to spawn into this frame. Use \| to put multiple windows in the same frame |
| requires_filepath | bool | template | If true, prompt for a working directory via fuzzel before creating the layout. The path is available as $MOGENWM_TEMPLATE_DIR in commands |
┌─────────────────────┐ │ │ │ editor (foot) │ 70% │ │ ├──────────┬──────────┤ │ terminal │ browser │ 30% │ (htop) │ (firefox)│ └──────────┴──────────┘
# ~/.config/morgenwm/templates/dev-layout.toml [[frame]] id = "root" type = "split" direction = "vertical" ratio = 0.7 left = "editor" right = "bottom" [[frame]] id = "editor" type = "leaf" command = "foot" [[frame]] id = "bottom" type = "split" direction = "horizontal" ratio = 0.5 left = "terminal" right = "browser" [[frame]] id = "terminal" type = "leaf" command = "foot -e htop" [[frame]] id = "browser" type = "leaf" command = "firefox"
morgenwm_msg action apply-template dev-layout
In config.toml:
[[keybindings]] key = "t" modifiers = ["Mod"] action = "template:dev-layout"
When a template is applied:
Leaves without a command stay empty, you can manually move windows into them later.