diff options
Diffstat (limited to 'tools/notify-send.c')
-rw-r--r-- | tools/notify-send.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/notify-send.c b/tools/notify-send.c index 67e0b03..589fe90 100644 --- a/tools/notify-send.c +++ b/tools/notify-send.c @@ -132,7 +132,7 @@ main (int argc, char *argv[]) static char **n_text = NULL; static char **hints = NULL; static gboolean do_version = FALSE; - static gboolean hint_error = FALSE; + static gboolean hint_error = FALSE, show_error = FALSE; static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT; GOptionContext *opt_ctx; NotifyNotification *notify; @@ -274,12 +274,19 @@ main (int argc, char *argv[]) } } - if (!hint_error) - notify_notification_show (notify, NULL); + if (!hint_error) { + retval = notify_notification_show (notify, &error); + + if (!retval) { + fprintf (stderr, "%s\n", error->message); + g_error_free (error); + show_error = TRUE; + } + } g_object_unref (G_OBJECT (notify)); notify_uninit (); - exit (hint_error); + exit (hint_error || show_error); } |