diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-10-18 23:41:29 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-10-18 23:41:29 +0200 |
commit | 1aeb5b86bb433823cabbf907f69bc87c313888ac (patch) | |
tree | 5c17f711ee742793a09c5fa3e9f861d2276ded49 | |
parent | 95ffaf3bd927f2dae71eb540dcb79e29020c6890 (diff) | |
download | desktop-tools-1aeb5b86bb433823cabbf907f69bc87c313888ac.tar.gz desktop-tools-1aeb5b86bb433823cabbf907f69bc87c313888ac.tar.xz desktop-tools-1aeb5b86bb433823cabbf907f69bc87c313888ac.zip |
dwmstatus: show the song name even when paused
-rw-r--r-- | dwmstatus.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dwmstatus.c b/dwmstatus.c index da2b78f..c19fda5 100644 --- a/dwmstatus.c +++ b/dwmstatus.c @@ -1368,18 +1368,20 @@ mpd_on_info_response (const struct mpd_response *response, free (ctx->mpd_status); ctx->mpd_status = NULL; + struct str s; + str_init (&s); + const char *value; if ((value = str_map_find (&map, "state"))) { if (!strcmp (value, "stop")) ctx->mpd_status = xstrdup ("MPD stopped"); - if (!strcmp (value, "pause")) - ctx->mpd_status = xstrdup ("MPD paused"); + else if (!strcmp (value, "pause")) + str_append (&s, "|| "); + else + str_append (&s, "|> "); } - struct str s; - str_init (&s); - if ((value = str_map_find (&map, "title")) || (value = str_map_find (&map, "name")) || (value = str_map_find (&map, "file"))) |