#window-manager #layout #left-wm

leftwm-layouts

Provides customizable layouts for list-based dynamic tiling window managers

28 releases

0.9.1 Mar 20, 2024
0.8.4 Jun 5, 2023
0.7.0 Feb 12, 2023
0.3.3 Dec 29, 2022
0.0.1 Mar 31, 2022

#68 in GUI

Download history 444/week @ 2024-08-12 405/week @ 2024-08-19 225/week @ 2024-08-26 60/week @ 2024-09-02 264/week @ 2024-09-09 395/week @ 2024-09-16 240/week @ 2024-09-23 72/week @ 2024-09-30 302/week @ 2024-10-07 483/week @ 2024-10-14 125/week @ 2024-10-21 79/week @ 2024-10-28 96/week @ 2024-11-04 73/week @ 2024-11-11 111/week @ 2024-11-18 98/week @ 2024-11-25

383 downloads per month
Used in 5 crates (2 directly)

BSD-3-Clause

135KB
3K SLoC

LeftWM Layouts

Library providing fixed but parameterized window layout calculations

Libraries.io dependency status for GitHub repo Crates.io Crates.io

Description

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.

Features

  • Already provides widely known default layouts
  • Custom layouts can be defined
  • Supports multiple main windows
  • Ultrawide monitor friendly
  • Zero dependencies (if you ignore serde 👀)

Pre-defined Layouts

The following layouts are already provided by the library.

Stack / Single-Column

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

Main and Stack / Two-Column

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

Center Main / Three-Column

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

Build

Build and test the project

Note Requires Rust >= 1.56.0

make

Run the demo application

Note Running the demo requires you to have GTK (gtk3) and pango (?) installed

make dev

Dependencies

~0.4–1MB
~22K SLoC