aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-03-20 16:26:50 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2019-03-20 16:26:50 +0100
commit99fbe99f8d9fcc9fa9f0d01f40104418fef8ba35 (patch)
tree6fe908e8dc3002df00dd43fdea746babe8fd8db6
parent02029aad51764b80a9b486569261ca5fb7048b38 (diff)
downloadscripts-99fbe99f8d9fcc9fa9f0d01f40104418fef8ba35.tar.gz
scripts-99fbe99f8d9fcc9fa9f0d01f40104418fef8ba35.zip
Minor improvements.
-rwxr-xr-xi3blocks/i3music.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/i3blocks/i3music.sh b/i3blocks/i3music.sh
index d0403f6..c0767fd 100755
--- a/i3blocks/i3music.sh
+++ b/i3blocks/i3music.sh
@@ -8,11 +8,11 @@ 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'/' -f5-)")]"
+[ -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"
elif [ "$stat" = "paused" ]; then