Hi there,
I've recently picked up yabai, and am setting up my own skhd file.
I want to create a layout toggle for a space, switching between float and bsp.
I noticed toggling existed within the documentation, but only for window related attributes.
I tried yabai -m space --layout --toggle with no luck.
Is it possible to create a toggle like this, or will I need to create two seperate hotkeys?
Furthermore, I understand these issues are not for usual help utilising the application and is centered around the development of it. Is there a community for this that exists for asking such questions?
You can read the current value with the following command: yabai -m query --spaces --space which will output information for the current space in json format. You can then use a text processor like jq to retrieve the type field, compare it with float or bsp to achieve your toggle.
I'm sure someone here can assist you with creating this, if need be.
I don't know of any community where you'd be able to ask these questions. For now I think this is the best place, and I don't mind it as long as the issue board is not flooded by this type of issues.
This one-liner will do. Requires jq (brew install jq).
yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')
@koekeishiya There's a bug (?) here, when using yabai -m space --layout bsp windows need to be interacted with once before they tile.
There's a bug (?) here, when using yabai -m space --layout bsp windows need to be interacted with once before they tile.
Tiles windows just fine for me. Tested both with my config floating all spaces at launch, opening windows, toggling layout to bsp. Also tested by having the space launch as bsp, toggling manually to float, opening windows and toggling back to bsp. All windows got tiled. This was tested in a single-display environment, if that matters.
I will investigate this a bit more and move this to the Catalina thread once I gathered some info as I can 100% reproduce it on the dev beta 2.
I have a multi-screen environment and when using the snippet provided to me from @dominiklohmann I have the same issue - I have to interact with the screen before it's "recalculated" but it's not 100%.
It seems that if I am in bsp, switch to floating and move them around, switching back to bsp doesn't recalculate.
If I am in floating, and I move a window to the space, and switch to bsp, it appears to recalculate.
I see what the issue is. We don鈥檛 destroy the layout like chunkwm did.
The issue is not that new windows are not detected, but if you close or move an existing windows we don鈥檛 respond to this because the view is not marked 芦dirty禄. Can you create a new issue for this?
Sent with GitHawk
Most helpful comment
This one-liner will do. Requires jq (
brew install jq).@koekeishiya There's a bug (?) here, when using
yabai -m space --layout bspwindows need to be interacted with once before they tile.