Tuesday, 30 November 2010

Introducing Synapse: Acetylcholine

As some of you know, during the summer I was working on a few Zeitgeist-related projects, one of them was Sezen and the panel-applet inspired by Sezen which allowed you to search Zeitgeist log conveniently from your panel. But I was never particularly happy with these solutions, and as a Gnome Do user, I was always disappointed that it is unable to find files the same way Sezen can, while the interface is pretty much a perfect fit for it. And that's when Synapse was born...

So what does Synapse do?
It well... searches stuff... If you ever used Gnome Do / Quicksilver / Gnome Launch Box, you'll feel right at home with Synapse, if not, the only thing you need to do is run Synapse (or press Ctrl+Space to summon it), type what you're looking for, and Synapse will present you a list of items that match your query. Once you found the item you were looking for, you can perform an action on it (and these are defined by the plugins you're using). If you don't like the default action, just press Tab and search appropriate action.
And besides this primary use-case, you can also browse recent items which were logged by Zeitgeist, in case you close a document by mistake or just want to hear again the music track that played a few minutes ago.

Acetyl... what?
I'm glad you agree that the release codename is just awesome, and besides that it's also a name of a neurotransmitter which transmits signals across synapse. But other than that it's an alias for Synapse 0.2.0.

How does it find stuff?
Using plugins of course - currently the development was focused primarily around using Zeitgeist for the searches, and there are even plugins that process the output from the Zeitgeist plugin and either try to improve the results, or find similar files on the filesystem (for example the Hybrid search plugin).
Still, all of the functionality is based on plugins, so further development can lead anywhere.

What plugins are available in Acetylcholine?
Current version ships with these plugins:
  • Applications - searches your desktop files
  • Banshee - allows you to play/enqueue music files in Banshee
  • Commands - runs any command (ie. "sudo apt-get update")
  • Devhelp - search documentation using Devhelp
  • Dictionary - find definitions of words
  • Directory search - allows opening of commonly used directories
  • Gnome session - log out, shut down, restart
  • Hybrid search - complete Zeitgeist results by searching for similar files
  • Rhytmbox - play/enqueue music files in Rhythmbox
  • UPower - suspend & hibernate your computer
  • Zeitgeist - search anything logged by Zeitgeist
How to get it?
You can either download the tarball from Launchpad. Or if using Ubuntu (Lucid/Maverick) add ppa:synapse-core/ppa to your sources and install "synapse" via the package manager. Please note that you need "zeitgeist-fts-extension" (and of course zeitgeist itself - preferably with as many dataproviders as possible) to experience it the way it was meant to be. :)

Please feel free to report bugs, ask questions, or talk to us in #synapse on freenode.

I want my app to provide results for Synapse!
The easiest way to do that would be to push data to Zeitgeist (or at least to recently-used) and you've got Synapse integration for free. If you need something more complex, we'll welcome your plugin. ;)

And before I wrap this post up, I want to thank everyone involved in the development - especially Alberto, who implemented the beautiful UI and designed most of the themes; then Seif, who (after finding out about the project, despite me trying to keep it a secret from him) helped a lot to steer it in the right direction and also came up with this great name; Izo who contributed us the icon and logo; and also all of our early beta testers (especially Mikkel, who had multiple good points and Ketilwaa, great idea with the codenames).

Tuesday, 16 November 2010

Did you ever wonder...?

how does a certain application do it's widget hierarchy in Gtk? Well lately I did, and therefore I wrote a little class that visualizes the allocation of the widget under your mouse (plus it's container). Add a little hacking with the dynamic linker and you get a small utility to inspect the widgets in (almost) any application. Take a look:

Gtk+ Inspector from Michal Hruby on Vimeo.

Unfortunately it's not perfect - atm it doesn't handle inner GdkWindows very well (as you can see in the video when I hover the GtkScrolledWindow), but maybe it could be easily fixed, I didn't really try as I didn't need that.
Also it doesn't work on just any application, I hooked the instantiation of my highlighting class to gtk_init(), so if your application doesn't call gtk_init(), it won't work (I'm afraid that also applies to all pygtk apps). Still, you can just compile your app with the Inspector class and instantiate it yourself.

Hopefully this will be useful for more people, so to see/grab the code, go to https://code.launchpad.net/~mhr3/+junk/inspector. And once you compile the .so file, run your favourite app using "LD_PRELOAD=./inspector.so [your_app]".