dwmstatus: show the song name even when paused

This commit is contained in:
Přemysl Eric Janouch 2016-10-18 23:41:29 +02:00
parent 95ffaf3bd9
commit 1aeb5b86bb
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 7 additions and 5 deletions

View File

@ -1368,18 +1368,20 @@ mpd_on_info_response (const struct mpd_response *response,
free (ctx->mpd_status); free (ctx->mpd_status);
ctx->mpd_status = NULL; ctx->mpd_status = NULL;
struct str s;
str_init (&s);
const char *value; const char *value;
if ((value = str_map_find (&map, "state"))) if ((value = str_map_find (&map, "state")))
{ {
if (!strcmp (value, "stop")) if (!strcmp (value, "stop"))
ctx->mpd_status = xstrdup ("MPD stopped"); ctx->mpd_status = xstrdup ("MPD stopped");
if (!strcmp (value, "pause")) else if (!strcmp (value, "pause"))
ctx->mpd_status = xstrdup ("MPD paused"); str_append (&s, "|| ");
else
str_append (&s, "|> ");
} }
struct str s;
str_init (&s);
if ((value = str_map_find (&map, "title")) if ((value = str_map_find (&map, "title"))
|| (value = str_map_find (&map, "name")) || (value = str_map_find (&map, "name"))
|| (value = str_map_find (&map, "file"))) || (value = str_map_find (&map, "file")))