Skip to content

Scripts to open new windows in i3wm using alternating layouts (splith/splitv) for each new window

License

Notifications You must be signed in to change notification settings

hwangeug/i3-alternating-layout

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

i3-alternating-layout

Scripts to open new windows in i3wm/Sway using alternating layouts (splith/splitv) for each new window. These scripts were made for /u/ke7ofi after they asked a question on how to do this you can read the question here.

Installation

Clone this repository.

Then, for i3 add:

exec --no-startup-id /path/to/i3-alternating-layout

to your ~/.i3/config.

Or, for Sway add:

exec /path/to/alternating

to your ~/.config/sway/config.

Fork Changes

This version has been forked to add an aspect ratio command-line argument. The previous behavior was to split vertically when the parent window's height is less than the window's width, but now, you may specify a maximum aspect ratio, above which a window will be split vertically. This is because:

  • Many applications are designed with an assumption that the viewport will be wider than it is tall.
  • On an ultrawide screen, the default behavior (essentially a max aspect ratio of 1.0) will not recreate a bspwm spiral-style layout - on for example, on a 21:9 screen, the spiral behavior will only start after two vertical splits.

To support additional CLI arguments, the script has also been rewritten to use the argparse library, instead of getopt.

Screenshot

Using regular i3/Sway, creating a window layout like this would involve a lot of $mod+Return, $mod+h and $mod+v. Using this script, you only need to open a bunch of new windows!

Screenshot

About

Scripts to open new windows in i3wm using alternating layouts (splith/splitv) for each new window

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%