diff --git a/config.def.h b/config.def.h index cd702de..7fddce7 100644 --- a/config.def.h +++ b/config.def.h @@ -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; diff --git a/dunst.c b/dunst.c index 585b492..b23063e 100644 --- a/dunst.c +++ b/dunst.c @@ -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; } diff --git a/dunstrc b/dunstrc index 3ef3e82..6797c8a 100644 --- a/dunstrc +++ b/dunstrc @@ -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