Add script option to override shown icon
This commit is contained in:
parent
d0662e78ec
commit
5a5dab2ff3
6
dunstrc
6
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
|
||||
|
3
rules.c
3
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;
|
||||
|
1
rules.h
1
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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user