Ubuntu One SyncDaemon API

Ubuntu One‘s SyncDaemon (the process that takes care of synchronizing your files between the cloud and the desktop) has a DBus interface for applications to control and get notifications from it about what it is doing. This interface was being used in the Nautilus plugin and other desktop tools contained in ubuntuone-client itself. Even though powerful and straightforward, we haven’t seen many applications using it, since usually 3rd party applications don’t want to be dealing with the low level DBus API themselves.

But this is now history, since I introduce you to libsyncdaemon, a GObject wrapper on top of the DBus API which makes it very easy to communicate with SyncDaemon, as well as improving a lot the performance compared to accessing the DBus API directly (thanks to its use of caches, to avoid DBus calls repeating when no needed) and containing high level functions that would allow applications to, for instance, publish a file on Ubuntu One with just one call:

SyncdaemonDaemon *daemon = syncdaemon_daemon_new ();
syncdaemon_daemon_publish_file (daemon, "/home/user/myphoto.jpg");

But before you run to another place after seeing this C code, note that it includes bindings for many languages (Python, JavaScript, etc) for free, thanks to gobject-introspection. So, the same code in Python, for instance, would be:

daemon = Syncdaemon.Daemon ()
daemon.publish_file ("/home/user/myphoto.jpg")

So now, the next step is to start adding support for sharing/publishing files in Ubuntu One to many desktop applications, like, for instance (ideas stolen from Stuart Langridge):

  • Publish screenshots directly from gnome-screenshot tool
  • Sharing photos from f-spot/shotwell/etc
  • etc…

This, along with the already existing desktop APIs (desktopcouch, couchdb-glib, libubuntuone), makes integration of 3rd party applications into Ubuntu One a very easy thing.

5 thoughts on “Ubuntu One SyncDaemon API”

  1. Very cool. The ubuntu one service is already giving me the feeling that ubuntu is one step in front of the rest in this field. Because if someone would explain to me what ubuntu one does, out of the box. I would have guessed it was a new OSX feature.

    And very cool that it is now getting easier for other developers to easily integrate with ubuntu one. I remember a while back that there was talk of getting gnome to integrate better with the web. I think this is a fantastic way of doing that.

    Of course it is all rather ubuntu specific I guess, which could be seen as a bad thing.

  2. @erik There’s nothing Ubuntu specific in U1 apart from the name. All desktop software is free (GPL/LGPL) and so anyone can package it for their preferred distro.

    Also, the protocol used is open, so anyone could implement their own server, if they want to. We are building on top of existing free software technologies (couchdb, gnome, etc), so there’s nothing Ubuntu-only specific at all.

  3. Rodrigo – is there an API for creating desktop clients not on Linux? I love Ubuntu, but I would love to see the service available for other systems as well. If so – please post a link.

  4. Ron, there isn’t, but work is underway to port u1-client to windows, so you should be able to use libsyncdaemon on Windows once the port is done

Comments are closed.