commit
da37135ef0
1 changed files with 19 additions and 30 deletions
49
neofetch
49
neofetch
|
@ -2332,7 +2332,7 @@ get_song() {
|
||||||
"deadbeef"
|
"deadbeef"
|
||||||
"deepin-music"
|
"deepin-music"
|
||||||
"dragon"
|
"dragon"
|
||||||
"elise"
|
"elisa"
|
||||||
"exaile"
|
"exaile"
|
||||||
"gnome-music"
|
"gnome-music"
|
||||||
"gmusicbrowser"
|
"gmusicbrowser"
|
||||||
|
@ -2373,19 +2373,18 @@ get_song() {
|
||||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${1}" /org/mpris/MediaPlayer2 \
|
dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${1}" /org/mpris/MediaPlayer2 \
|
||||||
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 '"' 'BEGIN {RS=" entry"}; /xesam:artist/ {a = $4} /xesam:album/ {b = $4}
|
awk -F '"' 'BEGIN {RS=" entry"}; /"xesam:artist"/ {a = $4} /"xesam:album"/ {b = $4}
|
||||||
/xesam:title/ {t = $4} END {print a " \n " b " \n " t}'
|
/"xesam:title"/ {t = $4} END {print a "\n" b "\n" t}'
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "${player/*\/}" in
|
case "${player/*\/}" in
|
||||||
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
|
"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')" ;;
|
||||||
"google play"*) song="$(gpmdp-remote current)" ;;
|
"google play"*) song="$(gpmdp-remote current)" ;;
|
||||||
"rhythmbox"*) song="$(rhythmbox-client --print-playing-format '%ta \n %at \n %tt')" ;;
|
"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}")" ;;
|
"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" ;;
|
||||||
|
@ -2404,6 +2403,7 @@ get_song() {
|
||||||
"amarok"*) get_song_dbus "amarok" ;;
|
"amarok"*) get_song_dbus "amarok" ;;
|
||||||
"dragon"*) get_song_dbus "dragonplayer" ;;
|
"dragon"*) get_song_dbus "dragonplayer" ;;
|
||||||
"smplayer"*) get_song_dbus "smplayer" ;;
|
"smplayer"*) get_song_dbus "smplayer" ;;
|
||||||
|
"rhythmbox"*) get_song_dbus "rhythmbox" ;;
|
||||||
|
|
||||||
"cmus"*)
|
"cmus"*)
|
||||||
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
|
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
|
||||||
|
@ -2416,7 +2416,7 @@ get_song() {
|
||||||
/tag title/ {
|
/tag title/ {
|
||||||
$1=$2=""; sub(" ", ""); t=$0
|
$1=$2=""; sub(" ", ""); t=$0
|
||||||
}
|
}
|
||||||
END { print a " \n " b " \n " t }')"
|
END { print a "\n" b "\n" t }')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"spotify"*)
|
"spotify"*)
|
||||||
|
@ -2425,57 +2425,46 @@ get_song() {
|
||||||
|
|
||||||
"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 & " \n " & album of current track as¬
|
string & "\n" & album of current track as¬
|
||||||
string & " \n " & name of current track as string')"
|
string & "\n" & 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 & " \n " & album of current track as¬
|
string & "\n" & album of current track as¬
|
||||||
string & " \n " & name of current track as string')"
|
string & "\n" & name of current track as string')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"banshee"*)
|
"banshee"*)
|
||||||
song="$(banshee --query-artist --query-album --query-title |\
|
song="$(banshee --query-artist --query-album --query-title |\
|
||||||
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
|
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
|
||||||
END {print a " \n " b " \n "t}')"
|
END {print a "\n" b "\n"t}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"exaile"*)
|
"exaile"*)
|
||||||
# NOTE: Exaile >= 4.0.0 will support mpris2.
|
# NOTE: Exaile >= 4.0.0 will support mpris2.
|
||||||
song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \
|
song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \
|
||||||
org.exaile.Exaile.Query |
|
org.exaile.Exaile.Query |
|
||||||
awk -F':|,' '{if ($6 && $8 && $4) printf $6 " \n" $8 " \n" $4}')"
|
awk -F':|,' '{if ($6 && $8 && $4) printf $6 "\n" $8 "\n" $4}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"quodlibet"*)
|
"quodlibet"*)
|
||||||
song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet \
|
song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet \
|
||||||
/net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\
|
/net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\
|
||||||
awk -F'"' '/artist/ {getline; a=$2} /album/ {getline; b=$2}
|
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
|
||||||
/title/ {getline; t=$2} END {print a " \n " b " \n " t}')"
|
/"title"/ {t=$4} END {print a "\n" b "\n" t}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"pogo"*)
|
"pogo"*)
|
||||||
song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player \
|
song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player \
|
||||||
org.freedesktop.MediaPlayer.GetMetadata |
|
org.freedesktop.MediaPlayer.GetMetadata |
|
||||||
awk -F'"' '/string "artist"/ {
|
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
|
||||||
getline;
|
/"title"/ {t=$4} END {print a "\n" b "\n" t}')"
|
||||||
a=$2
|
|
||||||
}
|
|
||||||
/string "album"/ {
|
|
||||||
getline;
|
|
||||||
b=$2
|
|
||||||
}
|
|
||||||
/string "title"/ {
|
|
||||||
getline;
|
|
||||||
t=$2
|
|
||||||
}
|
|
||||||
END {print a " \n " b " \n " t}')"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*) mpc &>/dev/null && song="$(mpc -f '%artist% \n %album% \n %title%' current)" ;;
|
*) mpc &>/dev/null && song="$(mpc -f '%artist%\n%album%\n%title%' current)" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[[ "$song" != *[a-z]* ]] && { unset -v song; return; }
|
[[ "$song" != *[a-z]* ]] && { unset -v song; return; }
|
||||||
|
|
Loading…
Reference in a new issue