From bc2dd71115f68e0aafcba331a9b817692e50a976 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 5 Jan 2017 16:19:43 +0100 Subject: give some extra status information --- mpd-notification.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mpd-notification.c b/mpd-notification.c index f37c219..90ed110 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -400,6 +400,8 @@ int main(int argc, char ** argv) { if (title == NULL) goto nonotification; + sd_notifyf(0, "READY=1\nSTATUS=Playing: %s", title); + /* initial allocation and string termination */ notifystr = strdup(""); @@ -437,11 +439,13 @@ int main(int argc, char ** argv) { } mpd_song_free(song); - } else if (state == MPD_STATE_PAUSE) + } else if (state == MPD_STATE_PAUSE) { notifystr = strdup(TEXT_PAUSE); - else if (state == MPD_STATE_STOP) + sd_notify(0, "READY=1\nSTATUS=" TEXT_PAUSE); + } else if (state == MPD_STATE_STOP) { notifystr = strdup(TEXT_STOP); - else + sd_notify(0, "READY=1\nSTATUS=" TEXT_STOP); + } else notifystr = strdup(TEXT_UNKNOWN); if (verbose > 0) -- cgit v1.2.3-54-g00ecf