Yuce's Blog

Cognitive dissonance is yoga for the brain.*

Getting the Currently Playing Song Info on Amarok via DCOP

2009-08-13

Here's a sample ap­pli­ca­tion for using DCOP with Python. Needed to install python-dcop on Debian. It works on KDE 3.5 with Amarok 1.4 (won't work on KDE 4)

import pydcop

playerService = pydcop.DCOPObject('amarok', 'player')

d = dict(
   title=playerService.title(),
   artist=playerService.artist(),
   album=playerService.album()
)
print '%(artist)s - %(title)s (%(album)s)' % d

kdcop is a great ap­pli­ca­tion to discover DCOP services.

I've posted a slightly extended version of this entry to Active State Python Cookbook.

python, DCOP, amarok, KDE

comments powered by Disqus