Clementine now playing in kopete

Hi
How to put a Clementine now playing in kopete, was something that I was
looking.
Well I found this blog, and possible the blogger he’s a member of this
forum, I don’t know but anyway, I didn’t find much answers goggling so
good as this one, and that’s the reason I’m posting in here.

So here’s the link to the blog , but I’ll put the code in here for
someone that doesn’t understand the language :

Create a place a file in your home/bin directory and make a chmod +x


#!/bin/bash
isClementineRunning=$(/usr/bin/qdbus | grep clementine)
echo yep
if  "$isClementineRunning" != "" ]
then
echo yep1
isClementinePlaying=$(/usr/bin/qdbus org.mpris.clementine /TrackList
org.freedesktop.MediaPlayer.GetCurrentTrack)
if  $isClementinePlaying != -1 ]
then
echo yep2
currentTrackIndex=$(/usr/bin/qdbus org.mpris.clementine /TrackList
org.freedesktop.MediaPlayer.GetCurrentTrack)
artist=$(/usr/bin/qdbus org.mpris.clementine /TrackList
org.freedesktop.MediaPlayer.GetMetadata $currentTrackIndex | grep artist)
title=$(/usr/bin/qdbus org.mpris.clementine /TrackList
org.freedesktop.MediaPlayer.GetMetadata $currentTrackIndex | grep title)
artist=${artist/artist: /}
title=${title/title: /}
/usr/bin/qdbus org.kde.kopete /Kopete org.kde.Kopete.setStatusMessage
"Now playing $title by $artist"
fi
fi


Then make a

crontab -e

to create a cron job for the script
insert this line :

* * * * * DISPLAY=:0.0 /home/WHATEVER/bin/ClementineNowPlaying.sh
&>/dev/null

And that’s it

Read more in :
http://fcoarias.wordpress.com/2011/07/13/como-poner-now-playing-con-clementinekopete/

http://fcoarias.wordpress.com/2011/08/17/nowplaying-con-clementinekopete-parte-ii-condiciones/


openSuSe 13.1