From e953fd9a5a12799f644b4db74711e08e5d096a69 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Tue, 19 Oct 2021 23:47:05 +0200 Subject: [PATCH] [sb-music] fix: song info parsing --- .local/bin/statusbar/sb-music | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index c9213cf..5c59b22 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -13,12 +13,12 @@ unicode() { sed "s/[‘’]/'/g;s/[“”]/\"/g"; } format() { sed "s/^volume:n\/a.*//g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g"; } -mpc="$(mpc --format "%albumartist% - %artist% - %title%")" -title="$(echo "$mpc" | head -n1 | cut -d'-' -f3 | unicode)" +mpc="$(mpc --format "%albumartist% ~ %artist% ~ %title%")" +title="$(echo "$mpc" | head -n1 | cut -d'~' -f3 | unicode)" [ "$(echo "$title" | wc -c)" -gt 18 ] && title="$(printf "%.15s..." "$title")" -artist="$(echo "$mpc" | head -n1 | cut -d'-' -f1 | unicode)" +artist="$(echo "$mpc" | head -n1 | cut -d'~' -f1 | unicode)" [ "Various Artists " = "$artist" ] && - artist="$(echo "$mpc" | head -n1 | cut -d'-' -f2 | unicode)" + artist="$(echo "$mpc" | head -n1 | cut -d'~' -f2 | unicode)" [ "$(echo "$artist" | wc -c)" -gt 18 ] && artist="$(printf "%.15s..." "$artist")" status="$(echo "$mpc" | tail -n2 | format)"