Skip to content
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

Toggling space related attributes #72

Closed
Oatelaus opened this issue Jun 26, 2019 · 6 comments
Closed

Toggling space related attributes #72

Oatelaus opened this issue Jun 26, 2019 · 6 comments
Labels
help wanted Community help appreciated question Request for information or help, not an issue

Comments

@Oatelaus
Copy link

Oatelaus commented Jun 26, 2019

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?

@koekeishiya
Copy link
Owner

koekeishiya commented Jun 26, 2019

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.

@koekeishiya koekeishiya added help wanted Community help appreciated question Request for information or help, not an issue labels Jun 26, 2019
@dominiklohmann
Copy link
Collaborator

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.

@koekeishiya
Copy link
Owner

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.

@dominiklohmann
Copy link
Collaborator

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.

@Oatelaus
Copy link
Author

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.

@koekeishiya
Copy link
Owner

I see what the issue is. We don’t 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’t respond to this because the view is not marked «dirty». Can you create a new issue for this?

Sent with GitHawk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Community help appreciated question Request for information or help, not an issue
Projects
None yet
Development

No branches or pull requests

3 participants