-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3+ column/row bsp layout #157
Comments
Here's what you need. # toggle split between vertical and horizontal
yabai -m window --toggle split
# balance all windows
yabai -m space --balance
# config: always keep windows balance
yabai -m config auto_balance on You can also convert all splits to vertical splits by creating a signal: on the signal From the signal you could filter also filter for a specific display or space index. There's many ways to improve on this. #! /usr/bin/env sh
# make this file executable using:
# chmod +x /path/to/this/script
# create a signal using:
# yabai -m signal --add event=window_created action="/path/to/this/script"
# get the window id of the newly created window
wid="${2}"
# if the split is horizontal, toggle it to vertical
yabai -m query --windows --window "${wid}" | jq -re '.split == "horizontal"' \
&& yabai -m window "${wid}" --toggle split |
@dominiklohmann thank you! |
Here's an even simpler version. Just save this in a file and execute it somewhere from your yabairc. Using insert directions for this has the additional advantage of avoiding the flicker effect of toggling the split whenever a new window is created. #! /usr/bin/env zsh
if [ "${#}" -eq 0 ]; then
# enable auto balance
yabai -m config auto_balance on
# register events
for event in window_focused application_activated; do
yabai -m signal --add label="${0}_${event}" event="${event}" \
action="${0}"
done
# when loading the script, convert all existing splits to horizontal
yabai -m query --windows \
| jq -r '.[] | select(.split == "horizontal").id' \
| xargs -I{} yabai -m window {} --toggle split
exit
fi
yabai -m window --insert "$(jq -nr \
--arg window_placement "$(yabai -m config window_placement)" \
--argjson display "$(yabai -m query --displays --display)" \
'[["west", "east"], ["north", "south"]][if $display | .frame | .w >= .h then 0 else 1 end][if $window_placement == "first_child" then 0 else 1 end]')" Edit: @net I updated the above script to work with vertical monitors as well (using rows over cols automatically) and simplified it a bit. |
Not perfect, nor 3+ column row bsp layout but this solves my issue that I can't bring the focused window to the bigger portal of the bsp tree Create this script and put it somewhere and follow the instructions
|
Any reason why |
Hi, I was also wondering if a three column layout was possible, and the suggestions didn't really help me. The following approach might be very buggy and certainly not elegant, but it rearranges the windows to a 3 column layout, which is fine for me. Maybe it helps.
|
This approach had been working well for me, but the 6.0 release breaks it since application_activated was removed. I tried just naively replacing application_activated with application_front_switched, but it didn't seem to work. I haven't done much investigation yet, but wondered if anyone has a fix already, or an idea of what the right thing to do would be. |
Is it possible to create a 3+ column or row layout like shown in this chunkwm gif?
I vaguely remember being able to rotate a subtree back in kwm, but that doesn't seem possible anymore.
I've been able to create stacked rows by changing split_ratio, but it hasn't been very reliable.
The text was updated successfully, but these errors were encountered: