Music: Added support for Clementine
This commit is contained in:
parent
aa6843048f
commit
21201a1abd
1 changed files with 12 additions and 1 deletions
13
neofetch
13
neofetch
|
@ -1081,7 +1081,7 @@ get_memory() {
|
||||||
|
|
||||||
get_song() {
|
get_song() {
|
||||||
# This is absurdly long.
|
# This is absurdly long.
|
||||||
player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|gnome-music|lollypop/ {printf $5 " " $6; exit}')"
|
player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|gnome-music|lollypop|clementine/ {printf $5 " " $6; exit}')"
|
||||||
|
|
||||||
case "${player/*\/}" in
|
case "${player/*\/}" in
|
||||||
"mpd"*)
|
"mpd"*)
|
||||||
|
@ -1187,6 +1187,17 @@ get_song() {
|
||||||
song="${song% - }"
|
song="${song% - }"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"clementine"*)
|
||||||
|
# dbus
|
||||||
|
song="$(
|
||||||
|
dbus-send --print-reply --dest=org.mpris.clementine /org/mpris/MediaPlayer2 \
|
||||||
|
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\
|
||||||
|
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\
|
||||||
|
awk -F '"' '/artist|title/ {printf $2 " - "}'
|
||||||
|
)"
|
||||||
|
song="${song% - }"
|
||||||
|
;;
|
||||||
|
|
||||||
*) song="Not Playing" ;;
|
*) song="Not Playing" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue