print notification on startup

This commit is contained in:
Sascha Kruse 2012-12-13 22:50:13 +01:00
parent 43b2b3bb1d
commit 3918fd32a8
3 changed files with 27 additions and 0 deletions

View File

@ -27,6 +27,12 @@ int line_height = 0; /* if line height < font height, it will be raised to fon
int separator_height = 2; /* height of the separator line between two notifications */
enum separator_color sep_color = AUTO; /* AUTO or FOREGROUND */
/* show a notification on startup
* This is mainly for crash detection since dbus restarts dunst
* automatically after a crash, so crashes might get unnotices otherwise
* */
int startup_notification = False;
/* monitor to display notifications on */
int monitor = 0;

17
dunst.c
View File

@ -1438,6 +1438,9 @@ void load_options(char *cmdline_config_path)
}
}
startup_notification = option_get_bool("global", "startup_notification",
"-startup_notification", false, "print notification on startup");
lowbgcolor =
option_get_string("urgency_low", "background", "-lb", lowbgcolor,
"Background color for notifcations with low urgency");
@ -1581,6 +1584,20 @@ int main(int argc, char *argv[])
signal (SIGUSR1, pause_signal_handler);
signal (SIGUSR2, pause_signal_handler);
if (startup_notification) {
notification *n = malloc(sizeof (notification));
n->appname = "dunst";
n->summary = "startup";
n->body = "dunst is up and running";
n->urgency = LOW;
n->icon = NULL;
n->msg = NULL;
n->dbus_client = NULL;
n->color_strings[0] = NULL;
n->color_strings[1] = NULL;
init_notification(n, 0);
}
run();
return 0;
}

View File

@ -89,6 +89,10 @@
# that fits nicely to the background color.
separator_color = auto
# print a notification on startup
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
[shortcuts]
# shortcuts are specified as [modifier+][modifier+]...key