koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
23.2k stars 641 forks source link

Is there a way to fix the layout of a space? #1302

Open ylorn opened 2 years ago

ylorn commented 2 years ago

Hi,

I am a first-time user of yabai. Not sure if this is a valid question, apologies if not.

For example, I want a space to have Xcode and Simulator to be presented, the Xcode app takes 75% of the space horizontally and the Simulator app takes the rest 25%. And every new window (Xcode or any other app that is not Simulator app) opened will stack into the existing Xcode window that is already opened.

How can I achieve this?

This is what I got so far:

assigning a dedicate space:

yabai -m space 5 --label xcode

yabai -m config --space xcode   layout       bsp
yabai -m config --space xcode   split_ratio  0.75

adding rules for Xcode and Simulator:

yabai -m rule --add app="^Xcode$"     space=xcode
yabai -m rule --add app="^Simulator$" space=xcode

Even though the space is correctly split vertically for Xcode and Simulator, it does not alway give Xcode the larger portion, which depends on who gets activated first. Is there a way to force a specific app to take larger ratio?

Also what is the best practice to achieve the rest of the expected behavior? That is:

I am aware I can achieve this by setting up keyboard shortcuts via skhd and doing it manually with key strokes, but I was wondering if there is any settings or signals that can be set up to perform automatically?

Thanks!

fangbinwei commented 2 years ago

Same problem. Some apps(Simulator) take up less than 50% of the width, while some apps have a minimum width that exceeds 50% of the width. It seems yabai can't handle this kind of scene very well