diff --git a/dunstrc b/dunstrc index 28a28fb..728e7cc 100644 --- a/dunstrc +++ b/dunstrc @@ -190,8 +190,8 @@ # Every section that isn't one of the above is interpreted as a rules to # override settings for certain messages. # Messages can be matched by "appname", "summary", "body" or "icon" and -# you can override the "timeout", "urgency", "foreground", "background" -# and "format". +# you can override the "timeout", "urgency", "foreground", "background", +# "new_icon", and "format". # Shell-like globbing will get expanded. # # SCRIPTING @@ -223,11 +223,13 @@ # appname = Pidgin # summary = "*signed on*" # urgency = low +# new_icon = "/usr/share/pixmaps/pidgin/status/16/log-in.png" # #[signed_off] # appname = Pidgin # summary = *signed off* # urgency = low +# new_icon = "/usr/share/pixmaps/pidgin/status/16/log-out.png" # #[says] # appname = Pidgin diff --git a/rules.c b/rules.c index 2b2478e..393f24c 100644 --- a/rules.c +++ b/rules.c @@ -15,6 +15,8 @@ void rule_apply(rule_t * r, notification * n) n->timeout = r->timeout; if (r->urgency != -1) n->urgency = r->urgency; + if (r->new_icon) + n->icon = r->new_icon; if (r->fg) n->color_strings[ColFG] = r->fg; if (r->bg) @@ -50,6 +52,7 @@ void rule_init(rule_t * r) r->icon = NULL; r->timeout = -1; r->urgency = -1; + r->new_icon = NULL; r->fg = NULL; r->bg = NULL; r->format = NULL; diff --git a/rules.h b/rules.h index 92a46de..c88ac17 100644 --- a/rules.h +++ b/rules.h @@ -17,6 +17,7 @@ typedef struct _rule_t { /* actions */ int timeout; int urgency; + char *new_icon; char *fg; char *bg; const char *format; diff --git a/settings.c b/settings.c index 4c4eb2e..fe3ed21 100644 --- a/settings.c +++ b/settings.c @@ -337,6 +337,7 @@ void load_settings(char *cmdline_config_path) free(urg); } } + r->new_icon = ini_get_string(cur_section, "new_icon", r->new_icon); r->fg = ini_get_string(cur_section, "foreground", r->fg); r->bg = ini_get_string(cur_section, "background", r->bg); r->format = ini_get_string(cur_section, "format", r->format); diff --git a/x.c b/x.c index 3aff9e0..6732d2e 100644 --- a/x.c +++ b/x.c @@ -298,7 +298,7 @@ static cairo_t *get_icon_surface(char *icon_path) fprintf(stderr, "Could not load icon: '%s'\n", icon_path); } - return NULL; + return icon_surface; } static colored_layout *r_init_shared(cairo_t *c, notification *n)