Fix whitespace issues with mpd module.

This commit is contained in:
Archie Hilton (thytom) 2019-10-25 13:11:58 +01:00
parent 2b024b483f
commit 5666ca42d7

View file

@ -5,20 +5,20 @@ PREFIX_PAUSE=' '
get_mpd()
{
current_song=$(mpc current)
current_song="$(mpc current)"
if [[ "$current_song" = "" ]]; then
exit 0
else
playpause=$(mpc | awk '/\[.*]/{split($0, a, " "); print a[1]}')
if [[ "$playpause" = "[playing]" ]]; then
current_song=$PREFIX_PLAY$current_song
current_song="$PREFIX_PLAY $current_song"
elif [[ "$playpause" = "[paused]" ]]; then
current_song=$PREFIX_PAUSE$current_song
current_song="$PREFIX_PAUSE $current_song"
fi
fi
echo $current_song
echo "$current_song"
}
get_mpd