This parses the i3 workspace tree from the i3 IPC to execute focus commands on the outermost tabbed container that has 1+ siblings.
If such a container is not found in the hierarchy up from the focused window to the root container then this will call a regular focus command. In theory this script can take any valid arguments that the i3 command focus
takes (e.g. prev
and next, etc.), however it has only been tested with
leftand
right.
The idea is this will move focus between the highest level containers without requiring several focus parent
commands if working with highly nested containers.
The following video demo is running with the following keybinds, i.e. the "normal" keybind to change focus instead runs this script with super+alt+(left/right) being a fallback to normal focus (left/right
.