diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-03-21 12:12:03 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-03-21 12:12:03 +0100 |
commit | 0799d2ef6f9f5e7c8f50fb927165fb868176fdf4 (patch) | |
tree | b3c07ec9d4b98d140123ec855009653c0f723331 | |
parent | 31f6f93f037cad9b4e0834dd35ccc953ab9d5439 (diff) | |
download | scripts-0799d2ef6f9f5e7c8f50fb927165fb868176fdf4.tar.gz scripts-0799d2ef6f9f5e7c8f50fb927165fb868176fdf4.zip |
Fixed an error caused by grepping without final space.
-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 c0767fd..fb5bc07 100755 --- a/i3blocks/i3music.sh +++ b/i3blocks/i3music.sh @@ -8,12 +8,13 @@ esac symbol=🎵 pgrep -x cmus >/dev/null || exit 0 -stat="$(cmus-remote -Q | grep "^status" | awk '{print $2}')" -artist="$(cmus-remote -Q | grep "^tag artist" | cut -d' ' -f3-)" -title="$(cmus-remote -Q | grep "^tag title" | cut -d' ' -f3-)" +stat="$(cmus-remote -Q | grep "^status " | awk '{print $2}')" +artist="$(cmus-remote -Q | grep "^tag artist " | cut -d' ' -f3-)" +title="$(cmus-remote -Q | grep "^tag title " | cut -d' ' -f3-)" [ -z "$artist" ] && artist="(unknown)" [ -z "$title" ] && title="$(basename "$(cmus-remote -Q | grep "^file" | cut -d' ' -f2- | sed 's/&/+/')")" # sed to fix & in title messing up script if [ "$stat" = "playing" ]; then + #echo "$symbol $artist ─ $title" echo "$symbol $artist ─ $title" elif [ "$stat" = "paused" ]; then echo "$symbol ( $artist ─ $title )" |