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

[Feature Request] Allow new managed windows to start as unmanaged or floating #2504

Open
diocletiann opened this issue Dec 28, 2024 · 7 comments

Comments

@diocletiann
Copy link

diocletiann commented Dec 28, 2024

I have custom placement logic for new windows, but new windows are immediately arranged with bsp and have to be moved, which causes a fair amount of noise and resizing. I tried making everything initially unmanaged but that creates other issues.

A setting like new-floating / new-unmanaged (or something to that effect) would be perfect. As always, thanks for maintaining this amazing tool.

@Bellavene
Copy link

Bellavene commented Dec 28, 2024

yabai -m rule --add app=".*" manage=off
yabai -m rule --apply

or just use float layout if it suits your case.

@diocletiann
Copy link
Author

yabai -m rule --add app=".*" manage=off
yabai -m rule --apply

or just use float layout if it suits your case.

I'm doing this now, but like I mentioned, it creates other issues. For example all managed windows become unmanaged when restarting the service.

@Bellavene
Copy link

Bellavene commented Dec 28, 2024

Just add rules to windows you want to manage.

You have not described correctly which config you have. So there is no way to understand your problem.

@4ltayebb
Copy link

4ltayebb commented Dec 28, 2024

Maybe this is closer to what OP wants. My first thought is to add a signal for window creation to make the new window float and maybe make all other "older" floating windows managed.

yabai -m signal --add event=<EVENT> action=<ACTION> [label=<LABEL>] [app[!]=<REGEX>] [title[!]=<REGEX>] [active=yes|no]

So you would have something like these two lines in your yabairc.

yabai -m rule --add label="manage_all" app=".*" manage=on
yabai -m signal --add event=window_created action='yabai -m rule --apply managed_all; yabai -m window $YABAI_WINDOW_ID --toggle float'

So this will have the effect of floating the new window only and making sure all other windows are managed by yabai. Of course you should exclude apps and windows you need to float all the time from this.
Check relevant signal documentation https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#signal.

@diocletiann
Copy link
Author

diocletiann commented Dec 28, 2024

@4ltayebb I tried signals (and I use them to call into my tool that does the placement) but in this case with bsp on, the window gets placed (and others shuffle/resize) before the --toggle float takes effect. It "works" but not as smoothly as I'd like.

So ideally, there would be a setting to start new windows as floating/unmanaged (and skip the bsp placement) without requiring a rule that could make them unmanaged after placement (e.g. service restart).

@diocletiann diocletiann changed the title [Feature Request] Allow floating for new managed windows [Feature Request] Allow new managed windows to start as unmanaged or floating Dec 28, 2024
@caferen
Copy link

caferen commented Dec 29, 2024

It'd be great to somehow ensure a new window is never inserted into the tree to avoid the disruption. Ideally, I should still be able to apply other rules (e.g. grid).

@Bellavene
Copy link

I agree, that it would be awesome if he had an option to avoid the built-in bsp logic and could tell it where to place the window. I don't see a reason why it was not added at the beginning. Because there is anyway not more than 5 windows per screen opened usually. So why not script their placement order right in yabai at least if we have no other layout options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants