-
Notifications
You must be signed in to change notification settings - Fork 340
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
Transitioning rules to a more consistent naming scheme #349
Comments
Are there any words which represent |
I would propose [critical]
has_body = "backup failed"
has_summary = "backup"
has_urgency = "normal"
set_urgency = "critical" |
I've been thinking rules could have a much more english-like format, something like:
The language for this is basically:
This is really based on pf and opensmtpd's syntax format, which are really readable. The upsides are:
Downsides:
|
If we're going to go this far with the matching logic, we might as well implement a full on filter language like newsbeuter.
I'm not sure this is an upside, having an option for a rule to be a single line would be good, but for a more complicated rule with multiple matches and assignments it can be much better to split it over multiple lines.
This is a big downside, it breaks the current configuration format meaning that the config parser will have to be reworked and that it breaks the ability for external tools to parse the config file if needed (for example I was just looking into using pythons ini capability to attempt to write a script to generate test cases). One workaround to this (albeit a bit ugly) might be to split rules into a different file(e.g. |
Yeah, the main point was once statement per rule. |
There hasn't been any work done for this and haven't really decided yet how to handle it. I'm bumping this to 1.5. |
While dunst-project#349 is something we should work towards we haven't transitioned any other rules so having this be the only one with the match_ prefix looks out of place. Lets keep it plain for now.
Rules are currently named in a very unpredictable matter in a way that one cannot easily distinguish between filter/match rules and actions. As an example
msg_urgency
is used to match the urgency andurgency
to override it. This is probably because at the start the attributes that could be matched were different than the attributes that could be overridden (i.e. matching on appname, body etc and overriding attributes like timeout or format).To fix that, I'd propose migrating to a much simpler naming scheme using
match_
andset_
prefixes.As an example the current matching rules would look like this:
match_appname
,match_summary
,match_urgency
And the assigning actions as follows:
set_timeout
,set_urgency
,set_foreground
,set_background
,set_icon
andset_format
The text was updated successfully, but these errors were encountered: