mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-09-20 06:12:54 +00:00
- Updated to current main - Added more user toggles to control the behaviour of btrtile into config.h - Simplified the btrtile gapps logic - Simplified the changes to dwl.c - Added two keybind functions to swap and toggle splits - Minor code cleanups - Added functionality to respect the client size hints
85 lines
3.7 KiB
Markdown
85 lines
3.7 KiB
Markdown
### Description
|
||
|
||
# btrtile - A Focus-Driven Tiling Layout
|
||
|
||
It provides a focus-driven, mouse- and keyboard-friendly tiling layout that grants you granular control over how clients are placed and resized.
|
||
|
||

|
||
|
||
---
|
||
|
||
# Why btrtile
|
||
|
||
While dwl’s patches folder is full of different layouts, I couldn't find suitable layout that would work well with my workflow and single ultrawide monitor setup. btrtile aims to solve that by introducing a layout strategy that splits clients according to user focus and pointer position.
|
||
|
||
---
|
||
|
||
# How it works
|
||
|
||
Clients live in a binary tree, every split has a ratio (50/50 by default).
|
||
|
||
When a new client opens, it splits the client you last focused. The pointer decides which side it lands on: left half of the client puts it on the left, and so on. If the area is wider than it is tall the split is vertical, otherwise horizontal. When several clients open at once, each one splits the previous one, so you get a nice spiral instead of a pile in one corner.
|
||
|
||
- **Mouse**
|
||
Drag a tiled client with `MODKEY` + left button to float it, drop it on another tiled client to place it next to it.
|
||
`MODKEY` + right button resizes the divider next to the client you grabbed, it follows the pointer 1:1.
|
||
- **Keyboard**
|
||
`setratio_h` / `setratio_v` move a divider, `swapclients` swaps a client with its neighbour in a direction,
|
||
`togglesplit` flips the direction of the split you're in (and keeps it that way),
|
||
`swapsplit` mirrors the split.
|
||
|
||
**config.h:**
|
||
```c
|
||
use_active_for_splits = 1; /* 1: split the last focused client, 0: the one under the pointer */
|
||
force_split = 0; /* 0: new client on the pointer's side, 1: always left/top, 2: always right/bottom */
|
||
preserve_split = 0; /* 1: splits keep their direction, 0: direction follows the shape of the area */
|
||
split_width_multiplier = 1.0f; /* split side by side when width >= height * this */
|
||
resize_interval_ms = 16; /* limits mouse resize updates, 16ms is ~60 per second */
|
||
```
|
||
|
||
`force_split = 2` gives you a predictable spiral if you don't want the pointer to matter.
|
||
`split_width_multiplier` is handy on wide monitors, where windows tend to stay wider than tall for a long time.
|
||
|
||
Smoother mouse resizing costs some cpu, so tune `resize_interval_ms` to your refresh rate.
|
||
If resizing feels sluggish, try compiling dwl with -O2/-O3.
|
||
|
||
---
|
||
|
||
# What It Doesn’t Handle
|
||
|
||
- **Suckless philosophy**
|
||
- Yea, it's a bloat. I tried to hide the suck inside a single file as much I could. While this approach is not ideal, it's how it's at least for now.
|
||
|
||
---
|
||
|
||
# Patch recommendations
|
||
|
||
1. **Patches that I use with my btrtile**
|
||
|
||
- [focusdir](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/focusdir)
|
||
Great patch to move focus between clients.
|
||
|
||
- [rotatetags](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/rotatetags)
|
||
Good patch to rotate the view or shift clients between tags.
|
||
|
||
- [warpcursor](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/warpcursor)
|
||
Moves cursor location to focused client.
|
||
|
||
- [pertag](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/pertag)
|
||
Allows each tag to have individual layout setups.
|
||
|
||
- [gaps](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/gaps)
|
||
Add gaps between clients.
|
||
|
||
---
|
||
|
||
### Download
|
||
- [git branch](https://codeberg.org/julmajustus/dwl/src/branch/btrtile-0.9)
|
||
- [0.8](./btrtile-v0.8.patch)
|
||
- [0.8 WITH gaps](./btrtile-v0.8-gaps.patch)
|
||
- [main-d16036e](./btrtile-d16036e.patch)
|
||
- [main-d16036e WITH gaps](./btrtile-gaps-d16036e.patch)
|
||
|
||
### Authors
|
||
- [julmajustus](https://codeberg.org/julmajustus)
|