I'm wondering if it's possible to toggle the split percentage on the fly somehow. For example, I'd like to be able to press a shortcut and toggle between 50% and 67%. So far, I've only been able to achieve this by changing the config and restarting yabai.
I personally would like to have more than a toggle:
Increase/decrease the split ratio for current node with a specified step size
(e.g. Amethyst default value is 5 percentage points, but this should be an option for the user)
| Shortcut | Description |
|---|---|
| mod1 + [-,=] | Increase/decrease split ratio for current node |
bspwm offers
*-r*, *--ratio* 'RATIO'|(+|-)('PIXELS'|'FRACTION')::
Set the splitting ratio of the selected node (0 < 'RATIO' < 1).
@kiryph, I believe what you鈥檙e asking is already possible (maybe except for percentages)?
e.g., yabai -m window --resize left:-20:0
@mattsawyer77 Thanks for your suggestion. I know that the resizing commands exist. But I am not too happy with them for following reasons:
The resizing commands require to specify a direction and if you want to increase or decrease. This means you need 8 mappings to be able to change the split ratio in different locations. The example config suggests:
# increase window size
shift + alt - a : yabai -m window --resize left:-20:0
shift + alt - s : yabai -m window --resize bottom:0:20
shift + alt - w : yabai -m window --resize top:0:-20
shift + alt - d : yabai -m window --resize right:20:0
# decrease window size
shift + cmd - a : yabai -m window --resize left:20:0
shift + cmd - s : yabai -m window --resize bottom:0:-20
shift + cmd - w : yabai -m window --resize top:0:20
shift + cmd - d : yabai -m window --resize right:-20:0
I find this more complicated than focusing the suitable node in the tree and change with two mappings the split ratio.
I have often simple layouts (tiling of two or three windows, other windows are on other screens or minimized or opened when necessary). This means changing the split ratio can be done immediately without changing focus.
Furthermore, I try to use both hands to have more relaxed hand positions. Preferably left hand for modifiers and right hand for hjkl, np, [], io, -=. The suggested mappings require to use only the left hand and therefore I consider them suboptimal.
E.g undo an overshoot when resizing by keeping the required keys pressed, requires to change the modifier keys you keep pressing for resizing and keep your finger of the same hand on the same key. I find it easier to keep my left on the same modifiers and change only a finger on my right hand switching from - to =.
Coming up with 8 new mappings following my preferred way of typing and have some mnemonics is more complicated.
Therefore I would prefer to limit the number of keys which have to be defined for the window manager.
Also resizing with the mouse sometimes does not work flawlessly and leaves simply a gap between the windows (right now observed for a tiling of chrome, macvim and iterm2). However, I would prefer to use the keyboard anyway.
Final personal note: the number of required mappings to operate with a bsp tree and yabai in general is currently my main concern with yabai. Further examples for this are the two sets of movements (swap or warp), modifying the layout (mirror on x or y-axis, rotate clockwise or counterclockwise), set insertion point.
I was happy noting the possibility to change focus of windows across screen borders with one set of mappings given here https://github.com/koekeishiya/yabai/issues/104#issuecomment-511237696.
Maybe I simply have to accept this. bspwm does not provide a solution here either.
I would have sticked with Amethyst which, however, does not support spaces which is crucial for my understanding of a modern desktop. Tiling window manager can be nice but I switch occasionally to a floating layout when I open many windows where the bsp tiling on my 1920x1080 screen is worse than floating. Other methods such as snapping or tools like spectacle are not too bad to quickly arrange windows in a floating layout. I also miss a tabbed mode for a node similar to i3

Sorry for my long reply. Simply ignore as much as you like.
Added a new command on master that will modify the split percentage of the window directly.
# increase size of the left-child (decrease size of right-child) of the containing node
yabai -m window --ratio rel:0.2
# increase size of the right-child (decrease size of left-child) of the containing node
yabai -m window --ratio rel:-0.2
# set the value of the split directly:
yabai -m window --ratio abs:0.75
Most helpful comment
Added a new command on master that will modify the split percentage of the window directly.