You are not logged in.
Pages: 1
Hi,
Trying to readout the current playing track in Banshee using dbus in Python. This works fine, but, when Banshee is not running and I run my Python script the dbus call causes Banshee to startup (WTF ). How can I prevent this from happening ? Is this a problem in Banshee or my code ?
#!/usr/bin/env python
import dbus
bus = dbus.SessionBus()
banshee = bus.get_object("org.bansheeproject.Banshee", "/org/bansheeproject/Banshee/PlayerEngine")
if banshee:
currentTrack = banshee.GetCurrentTrack()
state = banshee.GetCurrentState()
if state == 'playing':
print(currentTrack['artist'] + " - " + currentTrack['name'])
else:
print "Stopped"
else:
print "Banshee not running"
Offline
Pages: 1