add album to song name for some players
This commit is contained in:
parent
fd04aa14ae
commit
9b94195ed9
1 changed files with 11 additions and 5 deletions
16
neofetch
16
neofetch
|
@ -1423,7 +1423,7 @@ guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo|elisa/ {printf $5 "
|
||||||
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
|
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
|
||||||
string:'Metadata' |\
|
string:'Metadata' |\
|
||||||
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\
|
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\
|
||||||
awk -F '"' '/artist/ {a=$2} /title/ {t=$2} END{print a " - " t}'
|
awk -F '"' '/artist/ {a=$2} /album"/ {b=$2} /title/ {t=$2} END{print a " - " b " - " t}'
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1450,13 +1450,14 @@ guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo|elisa/ {printf $5 "
|
||||||
song="$(audtool current-song)"
|
song="$(audtool current-song)"
|
||||||
|
|
||||||
# Remove Album from 'Artist - Album - Title'
|
# Remove Album from 'Artist - Album - Title'
|
||||||
song="${song/-* -/-}"
|
#song="${song/-* -/-}"
|
||||||
|
|
||||||
[[ -z "$song" ]] && get_song_dbus "audacious"
|
[[ -z "$song" ]] && get_song_dbus "audacious"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"cmus"*)
|
"cmus"*)
|
||||||
song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "}\
|
song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "}\
|
||||||
|
/tag album/ {$1=$2=""; print; print " - "}\
|
||||||
/tag title/ {$1=$2=""; print}')"
|
/tag title/ {$1=$2=""; print}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -1465,14 +1466,16 @@ guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo|elisa/ {printf $5 "
|
||||||
"Linux") get_song_dbus "spotify" ;;
|
"Linux") get_song_dbus "spotify" ;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
song="$(osascript -e 'tell application "Spotify" to artist of current track as \
|
song="$(osascript -e 'tell application "Spotify" to artist of current track as¬
|
||||||
|
string & " - " & album of current track as¬
|
||||||
string & " - " & name of current track as string')"
|
string & " - " & name of current track as string')"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"itunes"*)
|
"itunes"*)
|
||||||
song="$(osascript -e 'tell application "iTunes" to artist of current track as \
|
song="$(osascript -e 'tell application "iTunes" to artist of current track as¬
|
||||||
|
string & " - " & album of current track as¬
|
||||||
string & " - " & name of current track as string')"
|
string & " - " & name of current track as string')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -1514,13 +1517,16 @@ guayadeque|yarock|qmmp|quodlibet|deepin-music|tomahawk|pogo|elisa/ {printf $5 "
|
||||||
|
|
||||||
[[ "$(trim "$song")" == "-" ]] && unset -v song
|
[[ "$(trim "$song")" == "-" ]] && unset -v song
|
||||||
|
|
||||||
# Display Artist and Title on separate lines.
|
# Display Artist, Album and Title on separate lines.
|
||||||
if [[ "$song_shorthand" == "on" && "$song" ]]; then
|
if [[ "$song_shorthand" == "on" && "$song" ]]; then
|
||||||
artist="${song/ -*}"
|
artist="${song/ -*}"
|
||||||
|
album="${song#*- }"
|
||||||
|
album="${album% -*}"
|
||||||
song="${song/*-}"
|
song="${song/*-}"
|
||||||
|
|
||||||
if [[ "$song" != "$artist" ]]; then
|
if [[ "$song" != "$artist" ]]; then
|
||||||
prin "Artist" "$artist"
|
prin "Artist" "$artist"
|
||||||
|
prin "Album" "$album"
|
||||||
prin "Song" "$song"
|
prin "Song" "$song"
|
||||||
else
|
else
|
||||||
prin "$subtitle" "$song"
|
prin "$subtitle" "$song"
|
||||||
|
|
Loading…
Reference in a new issue