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:
14dc912
)
Show current MPD file
author
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 3 Jul 2018 21:25:21 +0000
(17:25 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 3 Jul 2018 21:25:21 +0000
(17:25 -0400)
bin/khatus_show
patch
|
blob
|
blame
|
history
diff --git
a/bin/khatus_show
b/bin/khatus_show
index
03ad6a9
..
f008d19
100755
(executable)
--- a/
bin/khatus_show
+++ b/
bin/khatus_show
@@
-342,6
+342,19
@@
mpd_state=$(
'
)
+mpd_current_file=$(
+ echo 'currentsong' \
+ | nc 127.0.0.1 6600 \
+ | awk -v max_chars=10 '
+ /^file:/ {
+ file = $2
+ for (i=3; i<=NF; i++) {file = file " " $i}
+ last = split(file, parts, "/")
+ print substr(parts[last], 1, max_chars)
+ }
+ '
+)
+
echo \
"\
E$energy\
@@
-370,7
+383,7
@@
echo \
\
V=$volume\
\
-
$mpd_state
\
+
[$mpd_state $mpd_current_file]
\
\
$signal_last_msg_age\
\
This page took
0.024784 seconds
and
4
git commands to generate.