DBUS, xhost, etc: remote control of amarok

Greg Woods woods at ucar.edu
Wed Feb 16 21:02:18 UTC 2011


I used to be able to do this fairly easily, but D-bus seems to have made
this a lot more complicated than it used to be. I just want to be able
to run a script via ssh to make Amarok do something (like pause, skip to
the next track, etc.). I have this command:

qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.Pause

This works fine, but only if I run it from an xterm launched from inside
the same X session as Amarok. If I try to do it through an ssh session,
I get this:

Could not connect to D-Bus server:
org.freedesktop.DBus.Error.Spawn.ExecFailed: /bin/dbus-launch terminated
abnormally with the following error: Autolaunch error: X11
initialization failed.

This happens whether the ssh user is the same user as the X session, a
different user, or root.

I have played around with various DISPLAY settings with no luck, but I
doubt if that will work in any event because according to lsof, Xorg
isn't even listening on the display port anyway. I have also tried, in
the X session, doing "xhost +" and that doesn't change anything either.
I confess that I really don't understand the connection between X and
D-bus, and all I really want is to make this work.

I am running Gnome and Amarok is a KDE app, so maybe there is some other
KDE-related service that needs to be started? Anybody been able to make
something like this work?

--Greg




More information about the users mailing list