Fixed mpd module to disappear when not active

This commit is contained in:
Archie Hilton (thytom) 2019-11-06 16:16:49 +00:00
parent ae163acf66
commit d5a6b65c28
2 changed files with 6 additions and 3 deletions

4
bar.sh
View file

@ -46,7 +46,9 @@ run_module()
out="$($DEFAULT_MODULES_DIR$1)" out="$($DEFAULT_MODULES_DIR$1)"
fi fi
if [[ ! "$out" = "" ]]; then if [[ "$out" = " " ]]; then
echo " " > "$OUTPUT_CACHE$module"
elif [[ ! "$out" = "" ]]; then
out="$out$SEPARATOR." out="$out$SEPARATOR."
echo "$out" > "$OUTPUT_CACHE$module" echo "$out" > "$OUTPUT_CACHE$module"
fi fi

View file

@ -1,13 +1,14 @@
#!/bin/bash #!/bin/bash
PREFIX_PLAY=' ' PREFIX_PLAY=' '
PREFIX_PAUSE=' ' PREFIX_PAUSE=' '
get_mpd() get_mpd()
{ {
current_song="$(mpc current)" current_song="$(mpc current)"
if [[ "$current_song" = "" ]]; then if [[ "$current_song" = "" ]]; then
echo " "
exit 0 exit 0
else else
playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}') playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}')