Merge pull request #1382 from arisinfenix/song
song: print empty tags correctly
This commit is contained in:
commit
0b3e3a5968
25
neofetch
25
neofetch
|
@ -2601,11 +2601,9 @@ get_song() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case ${player/*\/} in
|
case ${player/*\/} in
|
||||||
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
|
|
||||||
"mocp"*) song="$(mocp -Q '%artist \n%album \n%song')" ;;
|
"mocp"*) song="$(mocp -Q '%artist \n%album \n%song')" ;;
|
||||||
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% \\n%album% \\n%title%')" ;;
|
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% \\n%album% \\n%title%')" ;;
|
||||||
"xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;;
|
"qmmp"*) song="$(qmmp --nowplaying '%p \n%a \n%t')" ;;
|
||||||
"qmmp"*) song="$(qmmp --nowplaying '%p\\n%a\\n%t')" ;;
|
|
||||||
"gnome-music"*) get_song_dbus "GnomeMusic" ;;
|
"gnome-music"*) get_song_dbus "GnomeMusic" ;;
|
||||||
"lollypop"*) get_song_dbus "Lollypop" ;;
|
"lollypop"*) get_song_dbus "Lollypop" ;;
|
||||||
"clementine"*) get_song_dbus "clementine" ;;
|
"clementine"*) get_song_dbus "clementine" ;;
|
||||||
|
@ -2632,18 +2630,19 @@ get_song() {
|
||||||
"plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;
|
"plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;
|
||||||
"io.elementary.music"*) get_song_dbus "Music" ;;
|
"io.elementary.music"*) get_song_dbus "Music" ;;
|
||||||
|
|
||||||
|
"mpd"* | "mopidy"*)
|
||||||
|
song="$(mpc -f '%artist% \n%album% \n%title%' current "${mpc_args[@]}")"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"xmms2d"*)
|
||||||
|
song="$(xmms2 current -f "\${artist}"$' \n'"\${album}"$' \n'"\${title}")"
|
||||||
|
;;
|
||||||
|
|
||||||
"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}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Reference in New Issue