Category Archives: Projects

Writing a plugin for Diodon

The new plugin system for Diodon brings about an easy way to extend Diodon with any feature you might think of.

That could be a Ubuntu One integration, or clipboard actions, copying clipboard content to pastebin, and many many more…

With this post I try to explain you quickly how you go about writing your own plugin and will also point you to other documentation which might be helpful.

Before you start writing your own plugin, one thing is important to know. Diodon uses the library libpeas for its plugin system. Such is used for instance for Gedit or Totem.
There is a good blog post which describes how libpeas works.

You find some sample plugins code written in C, Vala or Python in the diodon bazaar branch plugin-sample.

You can check out and build it with following commands:

bzr branch lp:~diodon-team/diodon/plugin-sample
cd plugin-sample
./waf configure --libdir ~/.local/share/
./waf build
./waf install

For this you have to have Bazaar, valac and the package diodon-dev installed.

sudo apt-get install bzr diodon-dev valac

It is recommended to write your plugin in Vala. However C and Python is allowed as well.

As you can see the sample is using waf as a build system (which I personally prefer). However if you want to build your plugin with autotools, take at look at peas-demo of libpeas itself. There you find also some more code how a plugin can be written.

The object you can access in your plugin is the Diodon Controller.

Here is a list of events and methods which are provided:

public signal void on_select_item(IClipboardItem item)
public signal void on_add_item(IClipboardItem item)
public signal void on_remove_item(IClipboardItem item)
public signal void on_clear()
public void select_item(IClipboardItem item)
public void execute_paste(IClipboardItem item)
public void remove_item(IClipboardItem item)
public void add_item(IClipboardItem item)
public Gee.List get_items()
public ConfigurationModel get_configuration()
public void show_history()
public void show_preferences()
public void clear()
public Gtk.Menu get_menu()

Currently, there is no api documentation available. Therefore, for now, please refer to the the source code comments on the Controller.

When you miss a method or an event which you would need in your plugin, please let me know. Best just report a bug and mark it as wishlist. We can than see what we can do.

To test your plugin, there are two location where you can put your files. For simple testing you can add it to ~/.local/share/diodon/plugins. When providing the plugin in a package you should install it to /usr/lib/diodon/plugins.

In both cases you have to activate you plugin in the preferences dialog:

When you finally have finished your plugin, you can publish it as you prefer. However, we as a Diodon Team are intrested to include good plugins in the Diodon source.
Plugins written in Vala will be preferred, however for none-core plugins python and C is allowed as well.
For such a request please report a bug and mark it as Wishlist.

I’m looking forward to see with what idea you come up to extend Diodon.

When will Diodon be stable for Oneiric?

I have found a few request in my Inbox today pointing out this question. I’m very happy to hear that so many are keen to use a stable Diodon version on Oneiric. I can tell you: So am I ;).

However I hope this blog post will clarify why Diodon is not already available for Oneiric in the stable ppa.

Firstly, you might say, the easiest and safest way would be to build and upload the latest stable release 0.5.0 for Oneiric. Yes it would be. Unfortunately, due to API changes in Unity this version does not even compile.

Such compile errors have been fixed while updating to a new plugin system. However this has brought about a lot of refactoring and therefore needs good testing. (read more about it on this blog post).

So before a stable release will be available, I need some more feedback of testers whether the new version has any regression or bugs.

For this checkout the daily ppa. Leave a comment on this post if everything runs smoothly or otherwise report a bug.

You can also take a look at the milestone 0.6.0 for an overview of open issues which need to be fixed before the stable release.

I’m working hard so a stable Diodon version will be available for Oneiric as soon as possible.

Ramping up plugin system for Diodon

I’ve been working on a plugin system for Diodon for quite a while. Now, finally, it is ready for testing in the daily ppa.

Before you go ahead testing the new version please remember that this code is in development state and therefore should not be used on a production system.

This said, let’s talk about what has really changed:
Basically Diodon still works as usual. However, under the hood a lot has changed.
First is to mention the update to gtk3 and dconf/GSettings. This changes bring about two consequences:

  • All your customized settings will be lost on a upgrade. So please check the preferences dialog.
  • Diodon will only be installable on Oneiric or higher (and of course on any other distribution with gtk3 support but then from source). Older versions of Diodon will still be available for older Ubuntu versions.

Furthermore, a lot of refactoring was needed to have a clean API for the plugin system. A blog post how you can develop your own plugin for Diodon will follow soon.
If you cannot wait 🙂 you might take a look at Libpeas which is the library Diodon uses for its plugin system.

Currently, Diodon has two plugins. One is the application indicator which is installed and activated per default with the diodon package.
Additionally is there a diodon-plugins package which currently only contains the Unity Lens Plugin.
When installed the Unity Lens is not activated per default and needs to be enabled in the Preferences Dialog of Diodon.

I will soon write a few other posts about the new plugin system. However this should do for now ;).

Looking forward to hear what you think about this move.

GemRB heading for Oneiric

Finally the new GemRB version 0.6.5 released on July 2011 is now available for Oneiric and of course other Ubuntu versions such as Natty,Maverick and Lucid.

The release notes states the following:
two new config options (off by default):
UseSoftKeyboard: Toggle use of software keyboard on devices that support one. It pops up when text input is required
TouchScrollAreas: Toggles a wider and visible gutter around the screen for scrolling the game area. Intended for devices with a touch interface.

You can find the package as always on my ppa.

More details see http://www.gemrb.org.