summaryrefslogtreecommitdiffstats
path: root/mpd-notification.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2018-05-28 15:50:15 +0200
committerGravatar Christian Hesse <mail@eworm.de>2018-05-28 15:52:01 +0200
commit6ff60a4a018cbbcf8fad562d000f14f1607c2f4e (patch)
tree9766ab97010126cea4e9f77ab2b58d5578db06e7 /mpd-notification.c
parent73c75b27cb62fc75d249a68802adb91c43206fba (diff)
downloadmpd-notification-6ff60a4a018cbbcf8fad562d000f14f1607c2f4e.tar.gz
mpd-notification-6ff60a4a018cbbcf8fad562d000f14f1607c2f4e.tar.zst
set notification timeout once
Diffstat (limited to 'mpd-notification.c')
-rw-r--r--mpd-notification.c5
1 files 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);