i3-autolayout

Introduction

i3-autolayout is a simple service which helps keep a reasonable windows layout for your i3 manager.

without i3-autolayout | with i3-autolayout :-------------------------:|:-------------------------: DEMO GIF without autolayout | DEMO GIF with autolayout

Without autolayout, you have to manually decide whether to split the windows horizontally or vertically.

Instead, when i3-autolayout service is enabled, the split mode is automatically selected to better distribute the width and the height of windows uniformly.

Of course, you can still perform a manual split: indeed, i3-autolayout aims to be as less invasive as possible.


Build & Usage

Requirements

Compiling

Install

What you essentially need is just the binary of the service.

By default, the binary can be found the directory target/release/i3-autolayout (no additional dependencies should be needed).

You can copy it in a convenient place within your filesystem and run it as daemon (e.g., run at i3 startup with the exec command in your i3 configuration).

If you want, you can find a simple bash script in the project which installs the binary beside a systemd service unit file.

You need to specify the prefix where the binary and the systemd unit will be placed. For example:

sudo ./install.sh --prefix /usr

Starting the service

If you have installed the systemd service unit, you can start the service within your i3 configuration.

Reload the list of installed units: systemctl --user daemon-reload

Append the following statement to your i3 configuration file (i.e. ~/.config/i3/config): exec_always systemctl --user start i3-autolayout


Alternatives

i3-auto-layout

I have discovered i3-auto-layout project only after I have created mine. So credit to that older project.

Some improvements over it: * Less overhead (dependencies and runtime). * i3-autolayout (this project) uses a simple single blocking thread runtime and simple "stdout" minimal logging (less CPU overhead). * i3-autolayout (this project) takes 2% of the virtual memory instead used by i3-auto-layout (alternative project). ``` COMMAND | VIRT (kb)


i3-autolayout | 3423 i3-auto-layout | 140140 `` *i3-autolayout(*this project*) checks the workspace and avoid horizontal splitting on monitor with a vertical configuration. *i3-autolayout` (this project) provides an optional systemd unit file, if you prefer a more "service-oriented approach".