-
Notifications
You must be signed in to change notification settings - Fork 343
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
Support regex matching in rules #1013
Comments
You cannot use a script to do this, but you should be able to do it the way you suggest inside of dunst. Dunst uses This should probably get documented better, but I hope this answers your question. |
Definitely does, thanks. |
@fwsmit Given that my notifications are coming through as:
which is captured using a script to just log every notification (skipping something like running
and things are not being ignored as I would expect. Is the format there correct? I will modify the "logging" to check trailing whitespace, but I would expect these to be ignored. I run |
Whoops, read the fnmatch documentation incorrectly. Dunst calls fnmatch without flags, but you need the FNM_EXTMATCH flag to have the behavior. It's a gnu extension, so I'll have to look to see how we can enable it on certain platforms. |
Looking into this, I found this PR: #659, which implements said feature, but it was decided it was not the right solution. Regex was deemed as the more correct solution. I'll look into how that could be implemented right now. I'll make a tracking issue to consolidate the different issues about this. |
Sounds good, want me to close this one? For what its worth, being able to filter using a script (perhaps return an exit code) could also be relatively agnostic to how the user wants to do it. Could be (potentially) less work on the |
No, you can keep this open. I'll close it when regex is implemented.
That's a possibility, but it would be easier for the user to use regex of course. For more advanced use cases which will never be supported by dunst this would be an option. |
This enables more advanced regular expression syntax. It can be enabled with `enable_posix_regex`. Fixes: dunst-project#1013 Fixes: dunst-project#645 Fixes: dunst-project#658
Will do! |
This enables more advanced regular expression syntax. It can be enabled with `enable_posix_regex`. Fixes: dunst-project#1013 Fixes: dunst-project#645 Fixes: dunst-project#658
@fwsmit it would look something like:
and not:
right? |
Actually looks like the commit has docs, let me read those. |
yes
also yes :) |
I opted for the extended syntax, as I don't think you will often need to match the special characters literally. |
Works perfectly for me, tried a handful of regex things like Also verified that the old syntax for Thanks for the feature! |
Cool. I'll add error messages for incorrect regex patterns and then I'll merge it. |
This enables more advanced regular expression syntax. It can be enabled with `enable_posix_regex`. Fixes: dunst-project#1013 Fixes: dunst-project#645 Fixes: dunst-project#658
Merged! |
Is there a better way to ignore things based on
summary
for a givenappname
(yes I am aware that I should usedesktop_entry
instead) than:For example, using a script based on the
appname
that just modifies theformat
like:where the script can use "better" pattern matching (basically just a bunch of
|
statements) and "return"format = ""
(to ignore the notification) manually?The text was updated successfully, but these errors were encountered: