song: simplify cmus

This commit is contained in:
Michael Straube 2019-12-29 11:02:30 +01:00
parent 541322beea
commit 92246e7b7f
1 changed files with 4 additions and 11 deletions

View File

@ -2640,16 +2640,9 @@ get_song() {
"cmus"*) "cmus"*)
# NOTE: cmus >= 2.8.0 supports mpris2 # NOTE: cmus >= 2.8.0 supports mpris2
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "}; song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; a=$0}
/tag artist/ { /tag album / {$1=$2=""; b=$0}
$1=$2=""; sub(" ", ""); a=$0 /tag title/ {$1=$2=""; t=$0}
}
/tag album / {
$1=$2=""; sub(" ", ""); b=$0
}
/tag title/ {
$1=$2=""; sub(" ", ""); t=$0
}
END {print a " \n" b " \n" t}')" END {print a " \n" b " \n" t}')"
;; ;;