home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d65d6c
)
Show mpd state
author
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 2 Jul 2018 21:48:42 +0000
(17:48 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 2 Jul 2018 21:48:42 +0000
(17:48 -0400)
bin/khatus_show
patch
|
blob
|
blame
|
history
diff --git
a/bin/khatus_show
b/bin/khatus_show
index
d506d3a
..
fc4415a
100755
(executable)
--- a/
bin/khatus_show
+++ b/
bin/khatus_show
@@
-289,6
+289,29
@@
signal_last_msg_age=$(
| tr -d ' '
)
| 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\
echo \
"\
E$energy\
@@
-315,6
+338,8
@@
echo \
W:[$wifi $(echo "$io_net" | awk '/^wlp3s0/ {print $2, $3}')]\
\
\
W:[$wifi $(echo "$io_net" | awk '/^wlp3s0/ {print $2, $3}')]\
\
\
+ $mpd_state\
+ \
$signal_last_msg_age\
\
$weather\
$signal_last_msg_age\
\
$weather\
This page took
0.028167 seconds
and
4
git commands to generate.