/ Published in: Python

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env python # -*- coding: utf-8 -*- # Simple script to get the current song being played by # exaile. # Author: Santiago Zarate <santiago [at] zarate [dot] net [dot] ve> # Blog: http://blog.santiago.zarate.net.ve # import sys, dbus bus = dbus.SessionBus() try: remote_object = bus.get_object("org.exaile.DBusInterface","/DBusInterfaceObject") iface = dbus.Interface(remote_object, "org.exaile.DBusInterface") if(iface.status() == 'playing'): message = '%s - %s - %s ' % (iface.get_title(), iface.get_album(), iface.get_artist()) else: message = 'Exaile is not playing' except dbus.exceptions.DBusException, e: message = 'Exaile is not running: %s' % e print message
URL: http://blog.santiago.zarate.net.ve/
Comments
