diff options
author | Christian Hesse <mail@eworm.de> | 2017-01-05 16:19:43 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2017-01-05 16:19:43 +0100 |
commit | bc2dd71115f68e0aafcba331a9b817692e50a976 (patch) | |
tree | d82bd85949c01e8831e0d651ff981d48f9e54bb2 | |
parent | 6d9d889371a4c1852f12b2625ebff75fce033a8d (diff) | |
download | mpd-notification-bc2dd71115f68e0aafcba331a9b817692e50a976.tar.gz mpd-notification-bc2dd71115f68e0aafcba331a9b817692e50a976.tar.zst |
give some extra status information
-rw-r--r-- | mpd-notification.c | 10 |
1 files 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) |