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

Make window matchers accept regex pattern #7

Open
offlinehacker opened this issue Jan 12, 2019 · 2 comments
Open

Make window matchers accept regex pattern #7

offlinehacker opened this issue Jan 12, 2019 · 2 comments

Comments

@offlinehacker
Copy link
Contributor

Issue

Currently window matchers only accept exact match. So that means if window class is chromium-browser, match_wm_class_contains = chromium would only match chromium window class and not chromium-browser class. I assume it's the same for other matchers.

Solution

Implement additional matchers (or change existing ones to match by regex). Example:

[Chromium]
suspend_delay = 10
match_wm_class_contains_pattern = (chormium|chromium-browser)
suspend_subtree_pattern = chromium
@kernc
Copy link
Owner

kernc commented Jan 12, 2019

Currently, they are contains matchers, not exact matchers.
So chromium matches chromium-browser.

xsuspender/src/rule.c

Lines 65 to 70 in 74e2835

// If all provided matching specifiers match
if (str_contains (wm_class_group, rule->needle_wm_class_group) &&
str_contains (wm_class, rule->needle_wm_class) &&
str_contains (wm_name, rule->needle_wm_name)) {
return rule;
}

But if regexes are implemented as part of #3, I'm probably 👍 for this as well.

@offlinehacker
Copy link
Contributor Author

Hmm interesting, i dunno why chromium does not work for me, only after i changed to chromium-browser it started to work, will investigate.

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

No branches or pull requests

2 participants