So, you hear that your media player supports remote control over D-Bus. That's great, isn't it?

So, you're lying on a couch, listening to music and reading a book on your N810. Suddenly a song you don't like starts playing. Do you

A. Stand up, walk to the PC, click the "Next song" button with your mouse,

or

B. Open Terminal on your N810, ssh into your desktop and run banshee-1 --next?

If you chose option B, you lose:

mg@mg-desktop:~$ banshee-1 --next
[Warn  00:43:59.080] DBus support could not be started. Disabling for this session.
[Info  00:43:59.101] Running Banshee 1.0.0

(Nereid:9174): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.

(Nereid:9174): Gtk-WARNING **: cannot open display: 

You can't access your D-Bus session from a different login session. This means, among other things, that I cannot ask gnome-power-manager to suspend my laptop that I left at work if I'm trying to run gnome-power-cmd.sh suspend over an SSH session.

Dear lazyweb, what's the fix?

P.S. I apologise for the impertinence of asking dear lazyweb a question on a blog that has no comments facility, but I somehow cannot bring myself to trust Pyblosxom's comment plugins in today's spam-filled world without an in-depth evaluation for which I don't have the time and energy. At least there's a mailto link clearly labeled "send feedback" below each blog entry.

Update: Steve Holden suggested using screen, which works, but only if I have the foresight to start a screen session on the desktop before I walk away. I can then reattach to the running screen session with screen -x and run banshee-1 --next inside.

Ross Burton says that setting DISPLAY=:0 ought to help D-Bus find the existing session, but only if I have the very latest and greatest D-Bus (1.2.1), which I don't have. With D-Bus 1.1.20 in Hardy, all I get by setting $DISPLAY is Banshee opening a second player instance.

Update #2: Lee Harr suggests fishing out the DBUS_SESSION_BUS_ADDRESS environment variable from ~/.dbus/session-bus/*.

Update #3: Kees Cook also has a solution.