From a8c81faf5ef88157d62a6665136597b2294b3b60 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Mon, 2 Jul 2018 17:48:42 -0400 Subject: [PATCH] Show mpd state --- bin/khatus_show | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bin/khatus_show b/bin/khatus_show index d506d3a..fc4415a 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -289,6 +289,29 @@ signal_last_msg_age=$( | tr -d ' ' ) +mpd_state=$( + echo 'status' \ + | nc 127.0.0.1 6600 \ + | awk ' + { + status[$1] = $2 + } + + END { + state = status["state:"] + symbol = "-" + if (state == "play") { + symbol = "▶" + } else if (state == "pause") { + symbol = "❚❚" + } else if (state == "stop") { + symbol = "⬛" + } + printf("%s", symbol) + } + ' +) + echo \ "\ E$energy\ @@ -315,6 +338,8 @@ echo \ W:[$wifi $(echo "$io_net" | awk '/^wlp3s0/ {print $2, $3}')]\ \ \ + $mpd_state\ + \ $signal_last_msg_age\ \ $weather\ -- 2.20.1