dbus session access from remote
In order to turn off the music playing on my desktop (in audacious) from my laptop in another room, I must figure out the DBUS session, and set it up before using the audacious session management control (like “--play-pause“).
$ ssh MACHINE "set -x export DISPLAY=:0.0 PID=\$(pidof audacious) if [ -z \"\$PID\" ]; then rhythmbox-client --pause else export DBUS_SESSION_BUS_ADDRESS=\\ \$(cat /proc/\$PID/environ | xargs -0 -n1 \\ | grep ^DBUS_SESSION_BUS_ADDRESS= | cut -d= -f2-) audacious --play-pause fi"









Useful tip, thanks!
Do you know how to pull the DBUS_SESSION_BUS_ADDRESS for an active user, as opposed to a running program?
I’d like to start a remote shell on demand that attaches to my remote dbus session (similar to above), but I don’t know what programs might be running at that time…
Comment by Sean
— 1/6/2009 @ 9:48 am
If the remote user is logged into X, you have all kinds of things. Use “pstree -lup” to see them. Probably the best might be x-session-manager, nautilus, or gnome-panel.
Comment by kees
— 1/6/2009 @ 10:52 am
which language is it? if i want to make a script out of it?
#!/bin/bash doesnt work…
Comment by Grunsch
— 2/8/2009 @ 3:39 am