Toqozz / wired-notify

Lightweight notification daemon with highly customizable layout blocks, written in Rust.
MIT License
606 stars 28 forks source link

Support for modifying icon #153

Open cecilialau6776 opened 2 months ago

cecilialau6776 commented 2 months ago

Dunst supports modifying icons with a new icon modification. I would like to be able to add an app icon to my notification based on the app name. For example, if I get a notification from Discord or Slack, I'd like to add the corresponding app icon to the notification.

I've two proposals for this:

  1. Add a new optional property to an ImageBlock (such as override_app_icon: Option<PathBuf>)
  2. Allow for scripts to be run before a notification is displayed.

It seems that option 1 is easiest to implement, but option 2 would allow me to also modify the notification based on other criteria. For example, I'd like to be able to run a regex or a string contains on a summary, and have it omit the body of the notification; I'd like to keep certain channels private but see the rest.

Toqozz commented 3 weeks ago

Thanks for the issue! This is a good idea. I really think we need a more dynamic approach to configuration (i.e. being able to run code at runtime) which would make a lot of these kinds of things 'just work'.

The plan is to move the configuration to Lua, and then you can have functions which fetch the icons etc using whatever logic you like. Granted, this is a longer term goal, so maybe it's worth adding something like option 1 in the meantime.