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)"
fi
if [[ ! "$out" = "" ]]; then
if [[ "$out" = " " ]]; then
echo " " > "$OUTPUT_CACHE$module"
elif [[ ! "$out" = "" ]]; then
out="$out$SEPARATOR."
echo "$out" > "$OUTPUT_CACHE$module"
fi

View file

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