Me sentant désespéré de ne plus avoir ces infos dans mon conky, j'ai créé un script qui répare ça:
#!/bin/bash
# clementine info display script by NHerby
case "$1" in
# Create a copy of the cover
cover)
file=`qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep artUrl`
FILENAME=$( echo "$file" | cut -c 22- )
if [ "$FILENAME" != "" ]
then
cp "$FILENAME" ~/.conky/cover.jpg
fi
;;
# Now Playing Info
status)
status=`qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus`
if [ "$status" == "Paused" ]
then status="Playing"
fi
echo $status
;;
artist) qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep artist | cut -c 15- ;;
title) qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep title | cut -c 14- ;;
album) qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep album | cut -c 14- ;;
year) qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep year | cut -c 12- ;;
genre) qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep genre | cut -c 14- ;;
progress)
curr=`qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Position`
tot=`qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep length`
total=$( echo "$tot" | cut -c 14- )
if [ "$total" != "" ]
then
let progress=curr*100
let progress=progress/total
fi
echo $progress
;;
esac
à placer dans ~/.conky/clementine
Je suis loin d'être un codeur donc ce script est la première méthode qui fonctionne que j'ai trouvée. Il y a certainement moyen de faire mieux...
Pour finir, voici la partie du conky qui permet d'afficher le résultat:
${if_running clementine}
${if_match "Playing" == "${execi 10 ~/.conky/clementine status}"}${color 4769ea}${font caviar dreams:size=10}Musique
${voffset -8}${hr}
${font caviar dreams:size=8}${color b5f9ff}${voffset 2}${goto 91}${execi 10 ~/.conky/clementine artist}
${goto 91}${execi 10 ~/.conky/clementine title}
${goto 91}${execi 10 ~/.conky/clementine album}
${image ~/.conky/cover.jpg -p 1, 786 -s 75x75 -f 10}${execi 10 ~/.conky/clementine cover}
${color 4769ea}${voffset -12}${execibar 2 ~/.conky/clementine progress}
$endif$endif