mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-21 18:12:53 +00:00
Fixed mpd module to disappear when not active
This commit is contained in:
parent
ae163acf66
commit
d5a6b65c28
2 changed files with 6 additions and 3 deletions
4
bar.sh
4
bar.sh
|
@ -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
|
||||||
|
|
|
@ -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]}')
|
||||||
|
|
Loading…
Reference in a new issue