Skip to content

Script to split in the longest direction on new windows

License

Notifications You must be signed in to change notification settings

mreppen/i3-new-split-long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

i3-new-split-long

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.

Installation

The script requires Python 3 and the library i3ipc to be installed.

Ubuntu

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

Arch Linux

Install python-i3ipc, clone the repo, then add

exec --no-startup-id /path/to/i3_long_split.py

to your ~/.i3/config.

Screenshot

This screenshot is from i3-alternating-layout, but in this instance, this script does the same thing.

Screenshot

Known problems

  1. Because splitting happens after window creation, this can cause a quick flicker from changing layout right after creation.
  2. 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.

About

Script to split in the longest direction on new windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages