Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

adjust split percentage #184

Closed
mattsawyer77 opened this issue Aug 1, 2019 · 4 comments
Closed

adjust split percentage #184

mattsawyer77 opened this issue Aug 1, 2019 · 4 comments
Labels
suggestion Request for new feature or some form of enhancement

Comments

@mattsawyer77
Copy link

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.

@kiryph
Copy link

kiryph commented Aug 4, 2019

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).

@mattsawyer77
Copy link
Author

@kiryph, I believe what you’re asking is already possible (maybe except for percentages)?

e.g., yabai -m window --resize left:-20:0

@kiryph
Copy link

kiryph commented Aug 4, 2019

@mattsawyer77 Thanks for your suggestion. I know that the resizing commands exist. But I am not too happy with them for following reasons:

  1. 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.

  2. 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 #104 (comment).

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

Screenshot 2019-08-04 at 18 09 31

Sorry for my long reply. Simply ignore as much as you like.

@koekeishiya koekeishiya added the suggestion Request for new feature or some form of enhancement label Sep 3, 2019
@koekeishiya koekeishiya changed the title toggle split percentage adjust split percentage Nov 9, 2019
@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Nov 9, 2019
@koekeishiya
Copy link
Owner

koekeishiya commented Nov 9, 2019

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

koekeishiya added a commit that referenced this issue Nov 9, 2019
@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Nov 9, 2019
brorbw pushed a commit to brorbw/yabai that referenced this issue Jan 28, 2020
brorbw pushed a commit to brorbw/yabai that referenced this issue Jan 28, 2020
brorbw pushed a commit to brorbw/yabai that referenced this issue Jan 28, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

3 participants