As far as I know, you need to grep the actual dbus-session of the machine that runs rythmbox. This is kind of tricky.
I have installed a script at my server, which is run after boot automatically, and which saves the current dbus-address to a file in my homedir.
If I ssh to the machine later, I can just grep the session-adress from there.
I: Script to store dbus adress:
name it "Get.Dbus.sh" and save it somewhere to your disk. Give it the following content:
set | grep DBUS_SESSION_BUS_ADDRESS > ~/.DBUS_temp
make it executable and add it to your start-items
II: Script to grep the current session:
name it "Run.DBus.sh" and save it in e.g. /usr/local/bin/
Give it the following content:
source /home/YOUR_USERNAME/.DBUS_temp
export DBUS_SESSION_BUS_ADDRESS
$*
don't forget to make it executable
III: ssh to your machine and start the rhythmbox-client as follows:
Run.DBus.sh rhythmbox-client
This works here!
Best Answer
I assume that you are creating some sort of plugin. Plugins can be written in C or Python. I don't know how to do this but I know where you could possibly find out this information: