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: Apply window rules via matching regular expression patterns #60

Closed
da-rth opened this issue Oct 29, 2021 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@da-rth
Copy link

da-rth commented Oct 29, 2021

Many window managers allow for you to apply a window rule for all windows which match a specific regular expression pattern. Currently, komorebi appears to apply rules based on the string equality of the window class name, executable name or title text.

By adding regex support for window rule defenitions, the window manager would be able to apply rules for a variety of windows without having an excessive amount of definitions. Additionally, the use of regular expression wildcards allows for powerful application of window rules:

komorebic.exe float-rule class "jetbrains-(.*)"

If possible, it may also be useful to pass multiple combinations of rule matches into a single komorebic.exe float-rule command:

komorebic.exe float-rule --class "jetbrains-(.*)" --title "Welcome to (.*)"

This would allow the user to combine a number of regular expressions based on various window attributes. The above example would apply a floating rule to all jetbrains windows which contain the title "Welcome to ..."

@da-rth da-rth changed the title Feature request: Define window rules using regular expression patterns Feature request: Apply window rules via matching regular expression patterns Oct 29, 2021
@LGUG2Z LGUG2Z added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 29, 2021
LGUG2Z added a commit that referenced this issue Sep 22, 2023
This commit is the first in a series of commits which will pave the way
for regex rule matching support in komorebi.

For now, in order to maintain backwards compat and not break anything,
all rules without a matching strategy will get assigned as using the
"Legacy" strategy.

This and the "Equals" strategy are the only two which have been
implemented so far.

There should not be any breaking changes in this commit, not any
functionality lost for users with pre-existing configurations.

re #60
@LGUG2Z LGUG2Z self-assigned this Sep 22, 2023
@LGUG2Z LGUG2Z pinned this issue Sep 24, 2023
@LGUG2Z
Copy link
Owner

LGUG2Z commented Sep 24, 2023

First implementation video for this feature: https://www.youtube.com/watch?v=yz6M9iQQs-8

LGUG2Z added a commit that referenced this issue Oct 6, 2023
This commit ensures that matching strategies can be used wherever
IdWithIdentifier is used, and that they are respected for users opting
to use the static configuration file format.

Some thought and planning needs to go into how this can be backported to
dynamic configurations via the CLI without breaking existing user
configurations.

re #60
@LGUG2Z LGUG2Z closed this as completed Oct 10, 2023
@LGUG2Z LGUG2Z unpinned this issue Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants