diff options
author | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-06 16:16:49 +0000 |
---|---|---|
committer | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-06 16:16:49 +0000 |
commit | d5a6b65c28795f363f9df6b12a0a1f226d846493 (patch) | |
tree | 952fe5c3f76ed0e246fd5ac4edd1663d920ba133 | |
parent | ae163acf66c539e24d4dd8f6186a031dae11c199 (diff) |
Fixed mpd module to disappear when not active
-rwxr-xr-x | bar.sh | 4 | ||||
-rwxr-xr-x | modules/mpd | 5 |
2 files changed, 6 insertions, 3 deletions
@@ -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 diff --git a/modules/mpd b/modules/mpd index 67c319f..ecbdd4e 100755 --- a/modules/mpd +++ b/modules/mpd @@ -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]}') |