linux_notification_center icon indicating copy to clipboard operation
linux_notification_center copied to clipboard

Scrippting match patterns

Open kristianvld opened this issue 2 years ago • 1 comments

It would be really nice to be able to match patterns and not only exact values.

For instance, being able to match any notifications with a word in the title or body would be nice. Either with simple pattern like

match = "title=*black*" # match any title containing the word black
...
match = "title=*black" # match any title ending in the word black
...
match = "title=/[0-9a-f]{16} black/i" # regex, match titles starting with a 16 digit hex number and ending in black, ignore case
...
match = "title=*" # matches all notifications

This on it's own could be really powerful, but even more so when #138 gets implemented.

The last example would also be a nice way to match any notifications. Currently I don't see any way to do this, even though I would expect an empty match to do this (as all [none] match conditions are met).

kristianvld avatar May 16 '22 16:05 kristianvld

Not entirely sure, but I think in https://github.com/phuhl/linux_notification_center/pull/138 you can match everything by having an empty match.

Then you could use the scripting method to match however you like in a script and only modify when you match, using this: image

Btw, you can test what is in https://github.com/phuhl/linux_notification_center/pull/138 as of today. The code is there. The only reason it is not merged, yet, is because it has a lot of braking changes regarding configuration. But one day, when I feel brave, I probably will merge.

If you try that, I'd love to hear your feedback on how it went

phuhl avatar May 18 '22 16:05 phuhl

Should be fixed by new config format

phuhl avatar Jan 12 '23 20:01 phuhl