Created
May 13, 2020 12:59
-
-
Save sulami/e867db25214fe6a00f6d981063b41cbb to your computer and use it in GitHub Desktop.
Yabai config for vertical stacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: sh -*- | |
# This implements automatic vertical stacking of windows in Yabai, like so: | |
# +------+ +---+--+ +---+--+ | |
# | | | | | | | | | |
# | | => | | | => | +--+ | |
# | | | | | | | | | |
# +------+ +---+--+ +---+--+ | |
yabai -m config auto_balance off | |
yabai -m config split_ratio 0.6 | |
yabai -m signal --add \ | |
label=new-window-tile \ | |
event=window_created \ | |
action='yabai -m window $YABAI_WINDOW_ID --warp last; \ | |
if [[ `yabai -m query --windows --space | jq -r "length"` = 2 ]] && [[ `yabai -m query --windows --window $YABAI_WINDOW_ID | jq -r ".split"` = "horizontal" ]]; then \ | |
yabai -m window --toggle split; \ | |
elif [[ `yabai -m query --windows --space | jq -r "length"` != 2 ]] && [[ `yabai -m query --windows --window $YABAI_WINDOW_ID | jq -r ".split"` = "vertical" ]]; then \ | |
yabai -m window --toggle split; \ | |
fi;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment