# libtmux.Window.select_layout

- **Module:** libtmux.Window
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/window.py#L848
- **Page:** https://libtmux.org/reference/py/libtmux-window-select_layout/

```
libtmux.Window.select_layout(self, layout: str | None = None, spread: bool | None = None, next_layout: bool | None = None, previous_layout: bool | None = None) -> Window
```

Select layout for window.

Wrapper for ``$ tmux select-layout <layout>``.

## Parameters

- `self`
- `layout` (str | None) — String of the layout, 'even-horizontal', 'tiled', etc. Entering
None (leaving this blank) is same as ``select-layout`` with no
layout. In recent tmux versions, it picks the most recently
set layout.
'even-horizontal'
Panes are spread out evenly from left to right across the
window.
'even-vertical'
Panes are spread evenly from top to bottom.
'main-horizontal'
A large (main) pane is shown at the top of the window and the
remaining panes are spread from left to right in the leftover
space at the bottom.
'main-vertical'
Similar to main-horizontal but the large pane is placed on the
left and the others spread from top to bottom along the right.
'tiled'
Panes are spread out as evenly as possible over the window in
both rows and columns.
'custom'
Custom dimensions (see :term:`tmux(1)` manpages).
- `spread` (bool | None) — Spread panes out evenly (``-E`` flag).
- `next_layout` (bool | None) — Move to the next layout (``-n`` flag).
- `previous_layout` (bool | None) — Move to the previous layout (``-p`` flag).

## Returns

:class:`Window`
    Self, for method chaining.

## Raises

- `libtmux.exc.LibTmuxException` — If tmux returns an error.
- `ValueError` — If both *layout* and a flag (*spread*, *next_layout*,
*previous_layout*) are specified.
