Crates.io | leftwm-layouts |
lib.rs | leftwm-layouts |
version | 0.9.1 |
source | src |
created_at | 2022-03-31 23:07:18.337954 |
updated_at | 2024-03-20 19:25:50.879027 |
description | Provides customizable layouts for list-based dynamic tiling window managers |
homepage | https://leftwm.org/ |
repository | https://github.com/leftwm/leftwm-layouts |
max_upload_size | |
id | 559954 |
size | 137,460 |
This library encapsulates layout calculations from external dependencies and display servers, so that it can be used by window managers for X.Org, Wayland, or whatever else. It's all about splitting up rectangles, the library has no concept of "windows".
Some default layouts are provided, but custom layouts can be defined. Custom layout
definitions allow some flexibility but are still fairly limited by design, as the target
audience of this library are list-based / dynamic-tiling window managers (the likes of leftwm
, dwm
, ...) as opposed to manual tilers like i3
.
The following layouts are already provided by the library.
Those layouts have only a single stack and no main column.
Monocle
+-----------+
| | only ever displays
| | one window at
| | maximum
+-----------+
EvenHorizontal
+--+--+--+--+
| | | | |
| | | | |
| | | | |
+--+--+--+--+
EvenVertical
+-----------+
|-----------|
|-----------|
|-----------|
+-----------+
Grid
+-----+-----+ +---+---+---+ +---+---+---+ +---+---+---+
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | +---+
+-----+-----+ | +---+---+ +---+---+---+ +---+---| |
| | | | | | | | | | | | | +---+
| | | | | | | | | | | | | | |
+-----+-----+ +---+---+---+ +---+---+---+ +---+---+---+
4 windows 5 windows 6 windows 7 windows
Those layouts have a main and one stack column
MainAndDeck
+-------+-----+
| | | only ever displays
| | | two windows at
| | | maximum
+-------+-----+
main stack
MainAndVertStack
+-------+-----+
| | |
| +-----+
| | |
+-------+-----+
main stack
MainAndHorizontalStack
+-------+--+--+
| | | |
| | | |
| | | |
+-------+--+--+
main stack
RightMainAndVertStack
+-----+-------+
| | |
+-----+ |
| | |
+-----+-------+
stack main
Fibonacci
+-------+-----+
| | |
| +--+--+
| |--| |
+-------+--+--+
main stack
Dwindle
+-------+-----+
| | |
| +--+--+
| | |--|
+-------+--+--+
main stack
Those layouts have the main column in the center and two stack columns surrounding it.
CenterMain
+-----+-----------+-----+
| | | |
| | +-----+
| | | |
| | +-----+
| | | |
+-----+-----------+-----+
1st main 2nd
stack stack
+-----------+-----------+
| | |
| | | unoccupied
| | | space is
| | | taken over
| | |
+-----------+-----------+
1st stack main
+-----------------------+
| |
| | unoccupied
| | space is
| | taken over
| |
+-----------------------+
main
CenterMainBalanced
+-----+-----------+-----+
| | | |
| | | |
+-----+ +--+--+
| |__| | |__|
| | | | | |
+-----+-----------+--+--+
1st main 2nd
stack stack
+-----------+-----------+
| | |
| | | unoccupied
| | | space is
| | | taken over
| | |
+-----------+-----------+
1st stack main
+-----------------------+
| |
| | unoccupied
| | space is
| | taken over
| |
+-----------------------+
main
CenterMainFluid
1st 2nd
stack main stack
+-----+-----------+-----+
| | | |
| | +-----+
| | | |
| | +-----+
| | | |
+-----+-----------+-----+
1st main 2nd
stack stack
+-----+-----------+-----+
| | |.....|
| | |.....| unoccupied
| | |.....| space is
| | |.....| reserved
| | |.....|
+-----+-----------+-----+
1st main
stack
+-----+-----------+-----+
|.....| |.....|
|.....| |.....| unoccupied
|.....| |.....| space is
|.....| |.....| reserved
|.....| |.....|
+-----+-----------+-----+
main
Note Requires Rust >= 1.56.0
make
Note Running the demo requires you to have GTK (
gtk3
) and pango (?
) installed
make dev