IPC script to automatically make the next split along the direction in which there is most space.
The code is based on i3-alternating-layout, which has the side effect of changing manual tiling behavior.
This script was built to preserve normal behavior, except for when new windows are created, and to implement a slightly different splitting logic. This comes with a (small) trade-off, documented in the "Known problems" section.
Note: I am running Sway. Others have tested it on i3.
The script requires Python 3 and the library i3ipc
to be installed.
sudo apt-get install python3-pip git
pip3 install i3ipc
git clone https://github.com/mreppen/3-new-split-long
And add i3_long_split.py
to your ~/.i3/config
autostart:
exec --no-startup-id /path/to/i3_long_split.py
Install python-i3ipc
, clone the repo, then add
exec --no-startup-id /path/to/i3_long_split.py
to your ~/.i3/config
.
This screenshot is from i3-alternating-layout, but in this instance, this script does the same thing.
- Because splitting happens after window creation, this can cause a quick flicker from changing layout right after creation.
- The IPC does not seem to allow subscriptions to window resizes. Window creation immediately after a resize could result in the wrong layout. If focus has changed in-between, this is not a problem.