Return to Snippet

Revision: 13157
at April 11, 2009 23:25 by foursixnine


Initial Code
#!/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

Initial URL
http://blog.santiago.zarate.net.ve/

Initial Description


Initial Title
Get exaile's current song through dbus from commandline

Initial Tags
Bash, python, script

Initial Language
Python