Check if Rhythmbox is running via Python
Posted
by
cschol
on Stack Overflow
See other posts from Stack Overflow
or by cschol
Published on 2011-01-08T18:30:30Z
Indexed on
2011/01/08
20:54 UTC
Read the original article
Hit count: 254
I am trying to extract information from Rhythmbox via dbus
, but I only want to do so, if Rhythmbox is running. Is there a way to check if Rhythmbox is running via Python without starting it if it is not running?
Whenever I invoke the dbus
code like this:
bus = dbus.Bus()
obj = bus.get_object("org.gnome.Rhythmbox", "/org/gnome/Rhythmbox/Shell")
iface = dbus.Interface(obj, "org.gnome.Rhythmbox.Shell)
and Rhythmbox is not running, it then starts it.
Can I check via dbus
if Rhythmbox is running without actually starting it? Or is there any other way, other than parsing the list of currently running processes, to do so?
© Stack Overflow or respective owner