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

windowrules: add 'solo' rule #4704

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

windowrules: add 'solo' rule #4704

wants to merge 1 commit into from

Conversation

haasn
Copy link
Contributor

@haasn haasn commented Feb 14, 2024

Describe your PR, what does it fix/add?

This adds a new window rule which matches a window if and only if it is the only non-floating window visible. Alternatively, it matches the window only if it is the 'root' of the layout tree.

See #2324

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

This is not necessarily the most elegant way of handling this condition. Perhaps it would be better to allow directly querying the number of floating / non-floating windows on the workspace, for example. That would allow encoding this rule with 'fullscreen:1andonworkspacenonfloating:1` (as two separate window rules).

But, I can't think of a good name for the "on workspace but non floating" rule. Maybe it would be better to instead generalize this substantially, so we could encode conditions in a more flexible way. But that is probably out-of-scope for this change.

Is it ready for merging, or does it need work?

Tested and working but see above.

This matches a window if and only if it is the only non-floating window
visible. Alternatively, it matches the window only if it is the 'root'
of the layout tree.

See hyprwm#2324
@phonetic112
Copy link
Contributor

can't you just do windowrulev2 = [rule], onworkspace:1, floating:0?

@haasn
Copy link
Contributor Author

haasn commented Feb 14, 2024

can't you just do windowrulev2 = [rule], onworkspace:1, floating:0?

Consider the situation of there being one non-floating and one floating window on the same workspace. Your condition would be false for both, but the condition I want would be true for the non-floating window, as it is the only non-floating window.

The motivating use-case here is that I want to remove borders around windows when there is no reason to draw them, which is the case whenever a window effectively covers the whole screen - either because it is fullscreened, or because it is the only non-floating window.

@vaxerski
Copy link
Member

I'd rather expand the onworkspace to support tiled and floating.

@haasn
Copy link
Contributor Author

haasn commented Feb 16, 2024

I'd rather expand the onworkspace to support tiled and floating.

Do we have a precedent for syntax? onworkspace.tiled:1, onworkspace:tiled:1?

@vaxerski
Copy link
Member

vaxerski commented Feb 16, 2024

1 tiled, 2 floating, 2 floating 1 tiled sounds reasonable

(eg onworkspace: 2 floating)

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

Successfully merging this pull request may close these issues.

None yet

3 participants