codeblog

8/5/2008

dbus session access from remote

Filed under: Blogging, Networking, Ubuntu — kees @ 8:49 pm

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”

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Facebook
  • Google
  • Technorati

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress