Package: i3-layouts-fixed
i3-layoutsi3-layoutsis a small program that enforces dynamic layout on i3 workspace.i3-layoutscomes with 6 configurable layouts:vstack: one main windows with a vertical stack of windows.hstack: one main windows with an horizontal stack of windows.spiral: each new windows split the previous one, split direction alternates between
horizontal and vertical.2columns: two vertical stacks of equally sized windows.3columns: one main windows with two vertical stacks of windows.companion: each columns is made of one main window and one smaller window.autosplit: automatically choose between vsplit/hsplit depending on the focused windows
(inspired byautotiling).Parameters for each one of these layouts is detailed in theLayout section.InstallationRequirementsInstallation with pipUpdate with pipRunningConfigurationAssigning a layout to a workspaceSwitching layoutMoving windows inside the layoutSwapping windowsLayoutsvstackhstackspiral2columns3columnscompanionautosplitLimitationsInstallationRequirementsBefore installingi3-layoutsbe sure to have the following installed on your system:python >= 3.7xdotooli3wmori3-gapsInstallation with pipTo install, simply usepip$ pip install --user i3-layoutsUpdate with pipTo update, again usepip$ pip install --user i3-layouts -URunningi3-layoutscan be started from a terminal
or better yet, launched from the i3 config file:exec i3-layoutsConfigurationConfiguration is done directly in the i3 config file (usually$HOME/.config/i3/config).i3-layoutsreads the entire config file, filter all$i3lvariables and
keeps the associated values as configuration. Note that user defined variables can be used
within$i3lvariables, as they will be replaced by their own value.Assigning a layout to a workspaceTo assign a layout to a workspace, use the name of the layout as value for the$i3lvariable,
followed by its parameters and then the targeted workspace name.Note that parameters are optional. However, if given, they must respect the order described
in theLayoutssection.Syntax:set $i3l [vstack|hstack|spiral|3columns|2columns|companion|autosplit] <param> ... to workspace [workspace name]Standard layouts from i3 can also be used:set $i3l [tabbed|splitv|splith|stacking] to workspace [workspace name]Examples:set $ws1 1
...
set $i3l vstack to workspace $ws1
set $i3l hstack 0.6 up to workspace $ws2
set $i3l spiral 0.6 to workspace $ws3
set $i3l 3columns 0.66 0.5 2 left to workspace $ws4
set $i3l 2columns right to workspace $ws5
set $i3l companion 0.3 0.4 up to workspace $ws6
set $i3l autosplit to workspace $ws7Switching layoutIt's also possible to dynamically switch the current workspace layout
via the providedi3lcommand with the layout name and its parameters as argument.If a layout name is given, and windows are already present,
they will be rearranged to match the selected layout.Ifnoneisi3lfirst argument,i3-layoutswill stop managing the current workspace layout.Syntax:i3l [vstack|hstack|spiral|3columns|2columns|companion|autosplit|none] <param> ...Examples:i3l vstack 0.6
i3l noneLayout can also be switched with a key binding viai3l, for example:bindsym $mod+s exec i3l vstack 0.6Usenotify-sendafter the previous command to receive a quick notification of the current layout:bindsym $mod+s exec i3l vstack 0.6 && notify-send 'Layout vstack'Moving windows inside the layoutBy default, when moving windows, chances are their position will not match the selected layout.
To keep windows within the layout possible positions,i3-layoutsmust manage allmovecommand.So instead of configuring i3 with something like:bindsym $mod+j move left
bindsym $mod+k move down
bindsym $mod+l move up
bindsym $mod+semicolon move rightmovecommands can be forwarded toi3-layoutsviai3l:bindsym $mod+j exec i3l move left
bindsym $mod+k exec i3l move down
bindsym $mod+l exec i3l move up
bindsym $mod+semicolon exec i3l move rightWith this configuration, if amovecommand is executed on a workspace managed byi3-layouts,
the moved window will stay within the layout. If the workspace is not managed byi3-layout,i3-layoutwill forward themovecommand toi3Swapping windowsBecausei3-layoutuses marks to keep track of container position, it must know about all
swap commands occurring within a layout.Likemovecommands,swapcommands can be forwarded toi3-layoutsviai3l:bindsym $mod+s exec i3l swap container with mark <arg>Note that currently, only the swap commandwith markis implemented
(soswap container with id <arg>orswap container with con_id <arg>will not work).To swap the focused container with the previously focused one, a custom command is also provided:bindsym $mod+p exec i3l swap container with previousLayoutsEach layout accept some specific parameters.
These parameters must be given is the order described below.vstackOne main windows with a vertical stack of windows.main window ratio(float between0and1, default0.5): ratio of screen width used
by the main windowsecondary stack position(rightorleft, defaultright): vertical stack position
relative to the main windowhstackOne main windows with an horizontal stack of windows.main window ratio(float between0and1, default0.5): ratio of screen height used
by the window stacksecondary stack position(upordown, defaultdown): horizontal stack position
relative to the main windowspiralEach new windows split the previous one, split direction alternates between
horizontal and vertical.split ratio(float between0and1, default0.5):
ratio of width or height used by the previous container at each split,
the remaining is used by the new container.screen direction(insideoroutside, defaultinside):
whether new container should be added towards the inside of the screen or the outside.2columnsTwo vertical stacks of equally sized windows.
New window position alternates between the first and second stack.first stack position(rightorleft, defaultleft): first stack position
relative to the second stack.3columnsOne main windows with two vertical stacks of windows.main window ratio[two columns] (float between0and1, default0.5):
ratio of screen width used by the main window when only two columns are presentmain window ratio[three columns] (float between0and1, default0.5):
ratio of screen width used by the main window when three columns are present. Width left
is distributed equally between the second and third columnsmax number of row in the second columns(int, default0):
the third columns is created only when the second column reach this number of container.
If0is given new container position alternate between the second and third columns.second column position(rightorleft, defaultright): second column position
relative to the main window. Note that the third column will have the opposite position
(if the second columns is on the left of the main window, the third one will be on the right of
the main window)companionEach columns is made of one main window and one smaller window (called companion container below).odd companion ratio(float between0and1, default0.3):
ratio of screen height used by the companion container for odd column indexeven companion ratio(float between0and1, default0.3):
ratio of screen height used by the companion container for even column indexcompanion position(up,down,alt-up,alt-down, defaultup):
position of the companion container relative to the main window.alt-upandalt-downalternate this position for each column, starting respectively atupanddownfor
the first column.autosplitWindows are automatically split either vertically or horizontally depending on
the focused window dimension.This layout has no parameters.LimitationsRedraw: when container are closed or moved between workspace,i3-layoutsneeds to reposition
some if not all containers of a given workspace.i3-layoutsusexdotoolto simulate the recreation of these containers.Marks: to keep track of container position,i3-layoutsuse i3wm marks.
More precisely,i3-layoutsmarks the first and last container of each workspace.