diff --git a/docs/dunst.pod b/docs/dunst.pod index 24636ab..a8954ed 100644 --- a/docs/dunst.pod +++ b/docs/dunst.pod @@ -594,7 +594,7 @@ Shell-like globing is supported. =item B The following attributes can be overridden: timeout, urgency, foreground, -background, new_icon, set_transient, format, fullscreen where, +background, frame_color, new_icon, set_transient, format, fullscreen where, as with the filtering attributes, each one corresponds to the respective notification attribute to be modified. @@ -644,7 +644,7 @@ The progress value can be set with a hint, too. =item notify-send -h string:fgcolor:#ff4444 -=item notify-send -h string:bgcolor:#4444ff -h string:fgcolor:#ff4444 +=item notify-send -h string:bgcolor:#4444ff -h string:fgcolor:#ff4444 -h string:frcolor:#44ff44 =item notify-send -h int:value:42 "Working ..." diff --git a/dunstrc b/dunstrc index 6707411..095cd98 100644 --- a/dunstrc +++ b/dunstrc @@ -279,7 +279,7 @@ # override settings for certain messages. # Messages can be matched by "appname", "summary", "body", "icon", "category", # "msg_urgency" and you can override the "timeout", "urgency", "foreground", -# "background", "new_icon" and "format", "fullscreen". +# "background", "frame_color", "new_icon" and "format", "fullscreen". # Shell-like globbing will get expanded. # # SCRIPTING diff --git a/src/dbus.c b/src/dbus.c index e532813..2685137 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -147,6 +147,7 @@ static notification *dbus_message_to_notification(const gchar *sender, GVariant gboolean transient = 0; gchar *fgcolor = NULL; gchar *bgcolor = NULL; + gchar *frcolor = NULL; gchar *category = NULL; RawImage *raw_icon = NULL; @@ -203,6 +204,12 @@ static notification *dbus_message_to_notification(const gchar *sender, GVariant g_variant_unref(dict_value); } + dict_value = g_variant_lookup_value(content, "frcolor", G_VARIANT_TYPE_STRING); + if (dict_value) { + frcolor = g_variant_dup_string(dict_value, NULL); + g_variant_unref(dict_value); + } + dict_value = g_variant_lookup_value(content, "category", G_VARIANT_TYPE_STRING); if (dict_value) { category = g_variant_dup_string(dict_value, NULL); @@ -289,6 +296,7 @@ static notification *dbus_message_to_notification(const gchar *sender, GVariant n->colors[ColFG] = fgcolor; n->colors[ColBG] = bgcolor; + n->colors[ColFrame] = frcolor; notification_init(n); return n; diff --git a/src/rules.c b/src/rules.c index 22e5bf3..20d7d5a 100644 --- a/src/rules.c +++ b/src/rules.c @@ -38,6 +38,10 @@ void rule_apply(rule_t *r, notification *n) g_free(n->colors[ColBG]); n->colors[ColBG] = g_strdup(r->bg); } + if (r->fc) { + g_free(n->colors[ColFrame]); + n->colors[ColFrame] = g_strdup(r->fc); + } if (r->format) n->format = r->format; if (r->script) @@ -79,6 +83,7 @@ void rule_init(rule_t *r) r->set_transient = -1; r->fg = NULL; r->bg = NULL; + r->fc = NULL; r->format = NULL; } diff --git a/src/rules.h b/src/rules.h index 9bee0a9..0e22eb8 100644 --- a/src/rules.h +++ b/src/rules.h @@ -28,6 +28,7 @@ typedef struct _rule_t { char *new_icon; char *fg; char *bg; + char *fc; const char *format; const char *script; enum behavior_fullscreen fullscreen; diff --git a/src/settings.c b/src/settings.c index 75aead6..aa0109d 100644 --- a/src/settings.c +++ b/src/settings.c @@ -679,6 +679,7 @@ void load_settings(char *cmdline_config_path) r->msg_urgency = ini_get_urgency(cur_section, "msg_urgency", r->msg_urgency); r->fg = ini_get_string(cur_section, "foreground", r->fg); r->bg = ini_get_string(cur_section, "background", r->bg); + r->fc = ini_get_string(cur_section, "frame_color", r->fc); r->format = ini_get_string(cur_section, "format", r->format); r->new_icon = ini_get_string(cur_section, "new_icon", r->new_icon); r->history_ignore = ini_get_bool(cur_section, "history_ignore", r->history_ignore);