From 59886c14477067710e06350e75ab9766df56c231 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Wed, 25 Jul 2012 10:06:26 +0200 Subject: [PATCH] added rules to config.def.h --- config.def.h | 12 ++++++++++++ config.mk | 2 +- dunst.c | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 71a7057..53204ee 100644 --- a/config.def.h +++ b/config.def.h @@ -29,3 +29,15 @@ keyboard_shortcut close_all_ks = {.str = "ctrl+shift+space", keyboard_shortcut history_ks = {.str = "ctrl+grave", .code = 0, .sym = NoSymbol,.is_valid = False}; /* ignore this */ + +rule_t default_rules[] = { + /* name can be any unique string. It is used to identify the rule in dunstrc to override it there */ + + /* name, appname, summary, body, icon, timeout, urgency, fg, bg, format */ + { "empty", NULL, NULL, NULL, NULL, -1, -1, NULL, NULL, NULL, }, + /* { "rule1", "notify-send", NULL, NULL, NULL, -1, -1, NULL, NULL, "%s %b" }, */ + /* { "rule2", "Pidgin", "*says*, NULL, NULL, -1, CRITICAL, NULL, NULL, NULL }, */ + /* { "rule3", "Pidgin", "*signed on*", NULL, NULL, -1, LOW, NULL, NULL, NULL }, */ + /* { "rule4", "Pidgin", "*signed off*", NULL, NULL, -1, LOW, NULL, NULL, NULL }, */ + /* { "rule5", NULL, "*foobar*", NULL, NULL, -1, -1, NULL, "#00FF00", NULL, }, */ + }; diff --git a/config.mk b/config.mk index 04e7dc1..87dfcb5 100644 --- a/config.mk +++ b/config.mk @@ -15,7 +15,7 @@ XINERAMALIBS = -lXinerama XINERAMAFLAGS = -DXINERAMA # uncomment to disable parsing of dunstrc -STATIC= -DSTATIC_CONFIG +#STATIC= -DSTATIC_CONFIG # inih flags INIFLAGS = -DINI_ALLOW_MULTILINE=0 diff --git a/dunst.c b/dunst.c index 875b323..668769b 100644 --- a/dunst.c +++ b/dunst.c @@ -1471,6 +1471,9 @@ int main(int argc, char *argv[]) now = time(&now); rules = l_init(); + for (int i = 0; i < LENGTH(default_rules); i++) { + l_push(rules, &default_rules[i]); + } #ifndef STATIC_CONFIG char *cmdline_config_path; cmdline_config_path = parse_cmdline_for_config_file(argc, argv);