<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,18 +4,9 @@ from whimsy.base_config import *
 
 import socket
 
-class mpd(object):
-    'control music player daemon (http://musicpd.org)'
-    def __init__(self, cmd):
-        self.cmd = cmd
-    def __call__(self, **kw):
-        try:
-            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-            s.connect(('localhost', 6600))
-            s.send(&quot;%s\n&quot; % self.cmd)
-            s.close()
-        except socket.error:
-            pass
+def corn(cmd):
+    return 'dbus-send --session --type=method_call --dest=org.mpris.corn '\
+            '/Player org.freedesktop.MediaPlayer.%s' % cmd
 
 wm.vwidth = W * 3
 wm.vheight = H * 3
@@ -39,11 +30,11 @@ chains = [
     (if_key(&quot;x&quot;, C+A), execute(&quot;urxvt&quot;)),
     (if_key(&quot;s&quot;, C+A), execute(&quot;sleep 1; xset s activate&quot;)),
 
-    (if_key(&quot;z&quot;, M4), mpd(&quot;previous&quot;)),
-    (if_key(&quot;x&quot;, M4), mpd(&quot;stop&quot;)),
-    (if_key(&quot;c&quot;, M4), mpd(&quot;play&quot;)),
-    (if_key(&quot;v&quot;, M4), mpd(&quot;pause&quot;)),
-    (if_key(&quot;b&quot;, M4), mpd(&quot;next&quot;)),
+    (if_key(&quot;z&quot;, M4), execute(corn(&quot;Prev&quot;))),
+    (if_key(&quot;x&quot;, M4), execute(corn(&quot;Stop&quot;))),
+    (if_key(&quot;c&quot;, M4), execute(corn(&quot;Play&quot;))),
+    (if_key(&quot;v&quot;, M4), execute(corn(&quot;Pause&quot;))),
+    (if_key(&quot;b&quot;, M4), execute(corn(&quot;Next&quot;))),
 
     (if_key('w', C+A), if_manipulable, delete_client()),
     (if_button(1,  A), if_manipulable, flipping_move()),</diff>
      <filename>config.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eaaf344bc8453d02492312b3597a90d0ea8ca469</id>
    </parent>
  </parents>
  <author>
    <name>Nick Welch</name>
    <email>mack@incise.org</email>
  </author>
  <url>http://github.com/mackstann/whimsy/commit/3c97a1f03ca59f1ff785cac578dc22f5f720f8ea</url>
  <id>3c97a1f03ca59f1ff785cac578dc22f5f720f8ea</id>
  <committed-date>2008-12-17T00:43:30-08:00</committed-date>
  <authored-date>2008-12-17T00:43:30-08:00</authored-date>
  <message>switch mpd stuff to corn dbus calls</message>
  <tree>f37b66045fb2952e548fcc80f58c8781d8e8c29e</tree>
  <committer>
    <name>Nick Welch</name>
    <email>mack@incise.org</email>
  </committer>
</commit>
