From 6ff60a4a018cbbcf8fad562d000f14f1607c2f4e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 28 May 2018 15:50:15 +0200 Subject: set notification timeout once --- mpd-notification.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mpd-notification.c b/mpd-notification.c index c0d8ced..1bdb55a 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -377,7 +377,8 @@ int main(int argc, char ** argv) { notify_notification_new(TEXT_TOPIC, TEXT_NONE, ICON_AUDIO_X_GENERIC, NULL); # endif notify_notification_set_category(notification, PROGNAME); - notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); + notify_notification_set_urgency(notification, NOTIFY_URGENCY_NORMAL); + notify_notification_set_timeout(notification, notification_timeout * 1000); signal(SIGHUP, received_signal); signal(SIGINT, received_signal); @@ -476,8 +477,6 @@ int main(int argc, char ** argv) { /* Call this unconditionally! When pixbuf is NULL this clears old image. */ notify_notification_set_image_from_pixbuf(notification, pixbuf); - notify_notification_set_timeout(notification, notification_timeout * 1000); - while(notify_notification_show(notification, &error) == FALSE) { if (errcount > 1) { fprintf(stderr, "%s: Looks like we can not reconnect to notification daemon... Exiting.\n", program); -- cgit v1.2.3-54-g00ecf