Welcome, guest | Sign In | My Account | Store | Cart
import pydcop

try:
    # get 'player' service of 'amarok' aplication
    playerService = pydcop.DCOPObject('amarok', 'player')

    # call service methods for getting song information
    info = dict(
        title=playerService.title(),
        artist=playerService.artist(),
        album=playerService.album()
    )

    print '%(artist)s - %(title)s (%(album)s)' % info

except RuntimeError, e:
    print 'Amarok is not running.'

# sample output:
# Mercyful Fate - A Dangerous Meeting (Don't Break The Oath)

History

  • revision 2 (14 years ago)
  • previous revisions are not available