From bc757456fdb3396e7237c3cb88f347c7bb9ee9c2 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 9 Jul 2015 22:27:38 +0200 Subject: make sure to use artwork when available --- mpd-notification.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mpd-notification.c b/mpd-notification.c index 189bba1..0bfa252 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -347,7 +347,13 @@ int main(int argc, char ** argv) { if (verbose > 0) printf("%s: %s\n", program, notifystr); - notify_notification_update(notification, TEXT_TOPIC, notifystr, icon ? icon : ICON_AUDIO_X_GENERIC); + /* What combinations do we have? + * icon pixbuf (impossible, icon is set only when !pixbuf) + * !icon pixbuf -> icon -> NULL (use pixbuf) + * !icon !pixbuf -> ICON_AUDIO_X_GENERIC + * icon !pixbuf -> icon */ + notify_notification_update(notification, TEXT_TOPIC, notifystr, + icon == NULL && pixbuf == NULL ? ICON_AUDIO_X_GENERIC : icon); if (pixbuf != NULL) notify_notification_set_image_from_pixbuf(notification, pixbuf); -- cgit v1.2.3-54-g00ecf