SwayNotificationCenter icon indicating copy to clipboard operation
SwayNotificationCenter copied to clipboard

[Feature Request] criteria-based styling

Open baodrate opened this issue 3 years ago • 2 comments

it'd be nice if styling options could be configured based on criteria. e.g. mako allows users to define styling/visibility options on criteria which are matched against the values in the notifications. It's very useful for assigning more granular visibility/urgency rules (most messaging apps don't send different urgency levels even if you are mentioned).

I imagine it'd work similarly to the current scripts and notification-visibility rules. To clarify, I'm picturing something along the lines of:

{
  "$schema": "/etc/xdg/swaync/configSchema.json",
  ...,
  "rules": {
    // could very well be an array
    "foobar": {
      // rules to match against
      "criteria": {
        "app-name": "Firefox",
        "urgency": "Critical",
        "summary": ".*foobar\\d+.*"
      },
      // override timeout for notifications that match
      "timeout": 600,
      // add css classes to this notification
      "classes": [
        "user-high-priority",
        "user-image"
      ]
    }
  }
}

Not sure of how big an ask this is, but it'd make swaync a lot more powerful, and I'd be able to translate my current mako config

baodrate avatar Apr 14 '22 23:04 baodrate

I too, would very much like to have something like this, though all I need at the moment is custom timeouts for certain app's notifications.

WTechNinja avatar Apr 19 '22 21:04 WTechNinja

Then we could probably merge the "notification-visibility" and "scripts" into this 🤔

ErikReider avatar May 07 '22 11:05 ErikReider