summaryrefslogtreecommitdiffstats
path: root/mpd-notification.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-07-09 22:27:38 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-07-09 22:29:23 +0200
commitbc757456fdb3396e7237c3cb88f347c7bb9ee9c2 (patch)
tree7a752f62f0914a30082b165c6a245f8bc2688ba9 /mpd-notification.c
parente31de6a142b9c312065eb4228215424fc1182ce2 (diff)
downloadmpd-notification-bc757456fdb3396e7237c3cb88f347c7bb9ee9c2.tar.gz
mpd-notification-bc757456fdb3396e7237c3cb88f347c7bb9ee9c2.tar.zst
make sure to use artwork when available
Diffstat (limited to 'mpd-notification.c')
-rw-r--r--mpd-notification.c8
1 files changed, 7 insertions, 1 deletions
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);