{"id":159,"date":"2008-08-05T20:49:29","date_gmt":"2008-08-06T04:49:29","guid":{"rendered":"http:\/\/www.outflux.net\/blog\/?p=159"},"modified":"2010-04-03T10:38:32","modified_gmt":"2010-04-03T18:38:32","slug":"dbus-session-access-from-remote","status":"publish","type":"post","link":"https:\/\/outflux.net\/blog\/archives\/2008\/08\/05\/dbus-session-access-from-remote\/","title":{"rendered":"dbus session access from remote"},"content":{"rendered":"<p>In order to turn off the music playing on my desktop (in <code>audacious<\/code>) 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 &#8220;<code>--play-pause<\/code>&#8220;).<\/p>\n<blockquote><p><code><\/p>\n<pre>$ ssh MACHINE \"set -x\r\nexport DISPLAY=:0.0\r\nPID=\\$(pidof audacious)\r\nif [ -z \\\"\\$PID\\\" ]; then\r\n    rhythmbox-client --pause\r\nelse\r\n    export \\$(xargs -0 -n1 \/proc\/\\$PID\/environ | grep ^DBUS_SESSION_BUS_ADDRESS=)\r\n    audacious --play-pause\r\nfi\"\r\n<\/pre>\n<p><\/code><\/p><\/blockquote>\n<p>(Updated to shorter version, thanks Kirikaza.)<\/p>\n<p style='text-align:left'>&copy; 2008 &#8211; 2010, <a href=\"https:\/\/outflux.net\/blog\/\">Kees Cook<\/a>. This work is licensed under a <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">Creative Commons Attribution-ShareAlike 4.0 License<\/a>.<br \/><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><img decoding=\"async\" alt=\"CC BY-SA 4.0\" style=\"border-width:0\" src=\"https:\/\/i.creativecommons.org\/l\/by-sa\/4.0\/88x31.png\" \/><\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;&#8211;play-pause&#8220;). $ ssh MACHINE &#8220;set -x export DISPLAY=:0.0 PID=\\$(pidof audacious) if [ -z \\&#8221;\\$PID\\&#8221; ]; then rhythmbox-client [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,7,14],"tags":[],"_links":{"self":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/159"}],"collection":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":2,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"predecessor-version":[{"id":336,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/159\/revisions\/336"}],"wp:attachment":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}