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

use globs for input config #959

Merged
merged 2 commits into from
Feb 19, 2024
Merged

use globs for input config #959

merged 2 commits into from
Feb 19, 2024

Conversation

Leon-Plickat
Copy link
Member

implements #741

@Leon-Plickat
Copy link
Member Author

Whoops, didn't see #819

I think this one is a bit more straight-forward though. Multiple configs matching an output is implicitly supported

Copy link
Member

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach of storing the glob directly in the InputConfig seems good.

The one thing I think needs more consideration is the handling of multiple globs matching a single input device and the order in which the the configs are applied.

I think we should keep the list of input configs sorted by generality of the globs just as we do with the RuleList abstraction. When a new config is added we would then do the following algorithm to apply configs to input devices:

for each input device:
    for each input config from most general to least general:
        if config glob matches device:
            apply config to device, possibly overwriting more general config

Does that make sense to you? We would also need to document this behavior in the man page.

@Leon-Plickat
Copy link
Member Author

I was initially going to leave input configs in order of declaration, but ordering by generality does make more sense on second thought.

@Leon-Plickat Leon-Plickat force-pushed the input-glob branch 2 times, most recently from e7e23d6 to e2ea8c8 Compare February 13, 2024 15:08
@ifreund ifreund added this to the 0.3.0 milestone Feb 13, 2024
@Leon-Plickat Leon-Plickat force-pushed the input-glob branch 4 times, most recently from 50eebf4 to 92e71dc Compare February 15, 2024 10:52
Copy link
Member

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@ifreund ifreund merged commit a7b174c into riverwm:master Feb 19, 2024
1 check failed
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.

2 participants