diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-02 14:23:33 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-02 14:23:33 +0100 |
commit | 58a9e65b5554b2c9552540dfea96b562375cf321 (patch) | |
tree | 118dbc0f74d7d09c328e5fbdecd118c7f3f23ee4 /i3blocks/i3music.sh | |
parent | 1ab2d661fb0ffa625d828792deabfb92a5c3611a (diff) | |
download | scripts-58a9e65b5554b2c9552540dfea96b562375cf321.tar.gz scripts-58a9e65b5554b2c9552540dfea96b562375cf321.zip |
Mon 02 Dec 2019 02:23:33 PM CET
Diffstat (limited to 'i3blocks/i3music.sh')
-rwxr-xr-x | i3blocks/i3music.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/i3blocks/i3music.sh b/i3blocks/i3music.sh index cad0b66..d446b50 100755 --- a/i3blocks/i3music.sh +++ b/i3blocks/i3music.sh @@ -7,18 +7,19 @@ case $BLOCK_BUTTON in esac symbol=🎵 -ampersand="I" +ampersand='and' # & in echo messes up script pgrep -x cmus >/dev/null || exit 0 stat="$(cmus-remote -Q | grep "^status " | awk '{print $2}' | sed "s/&/$ampersand/")" artist="$(cmus-remote -Q | grep "^tag artist " | cut -d' ' -f3- | sed "s/&/$ampersand/")" title="$(cmus-remote -Q | grep "^tag title " | cut -d' ' -f3- | sed "s/&/$ampersand/")" [ -z "$artist" ] && artist="(unknown)" -[ -z "$title" ] && title="$(basename "$(cmus-remote -Q | grep "^file" | cut -d' ' -f2- | sed "s/&/$ampersand/")")" # sed to fix & in title messing up script +[ -z "$title" ] && title="$(basename "$(cmus-remote -Q | grep "^file" | cut -d' ' -f2- | sed "s/&/$ampersand/")")" if [ "$stat" = "playing" ]; then - #echo "$symbol $artist ─ $title" echo "$symbol $artist ─ $title" + echo "$symbol ...$title" elif [ "$stat" = "paused" ]; then echo "$symbol ( $artist ─ $title )" + echo "$symbol ( ...$title )" else echo "$symbol $stat" fi |