ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.17k stars 60 forks source link

[Feature Request] criteria-based styling #114

Open baodrate opened 2 years ago

baodrate commented 2 years ago

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

WTechNinja commented 2 years ago

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.

ErikReider commented 2 years ago

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