All Unkept
Posted in: Python, KDE, Linux  —  February 23, 2008 at 09:12 PM

Personal wiki and desktop integration

by Luke Plant

Like many people, I find it easier to find stuff on the web than on my own machine. This post is about some of my attempts to remedy that. You probably need to be a developer or that way inclined to get the most out of some of the solutions I've got here. Stuff to download is at the bottom.

Search tool §

Obviously, first of all there is a need for a decent desktop search tool. On Linux, your main options are:

  • Google desktop search
    • Main problem: it stops it's initial index after 100,000 documents. I've got far more than that, and it means it never actually reaches my mail. Typical crippleware. This is useless for me.
  • Beagle
    • Main problem: it will decide to thrash your disk and/or CPU and crash. For me, runaway CPU usage and crashing made this completely useless. It might be 99% of the way to being brilliant, but until these things are sorted out, it is a 100% waste of time.
  • Strigi
    • Minor problem: the GUIs suck
    • Minor problem: it indexes too much, sometimes.
    • Main problem: after indexing about 300,000 documents, Strigi dies on me and refuses to do anything useful at all. I don't know what causes it to choke, but it, too, is 100% useless AFAIC. Maybe it's fixed now, but I've got bored of filing bugs and compiling from source just to find out it still doesn't work.
  • MetaTracker, or Tracker for short.
    • It can't search zip files etc. like Strigi can, which is a shame.
    • It doesn't yet index my emails (KMail) -- it only does evolution.
    • But I actually find this tool useful, . It doesn't thrash my disk, it has a simple but effective GUI, as well as command line tools, it integrates reasonably well into KDE, and it also has a nice tagging facility.

Tagging and Konqueror §

Adding tags to files needs to be easy to do if it's going to happen. MetaTracker provides the tracker-tag program which works well, but it is command line. So I've written a small GUI wrapper that integrates into Konqueror via a service menu. If you tag more than one file at once (by selecting a few files in Konqueror), it is in bulk tag mode, where it pops up an input box and simple adds the space-separated tags you enter to all the files.

In single file mode, it does something slightly different. It will first query the file for any existing tags, adding them to the default text that is in the input box, so that you can remove tags as well as add new ones. It will also add a suggestion for an 'ID' tag -- based on the filename, with punctuation replaced by hyphens, and with 'ID-' prepended. The idea is that I edit this and make it into something that will uniquely identify that file. For example, a file "bible reading schedule.pdf" ends up with the tag ID-bible-reading-schedule-pdf, but "rest-quickref2.html" I will expand to "ID-restructured-text-quickref-html", and in some cases I would have to include something else that will distinguish it.

The nice thing about these tags is that MetaTracker will keep track of them even if I move or rename the file. I'm not entirely sure how it does this (I think it uses inotify). But it works, and that's all I care about for now.

Migrating §

It may be that strigi / Nepomuk will mature and become useful. When they do, I can dump the tag database from MetaTracker pretty easily, and should be able to import into strigi. Changing the tools/scripts I've developed to use a different metadata database should be pretty simple.

Personal wiki §

On top of this, there are other things that file systems are just not very helpful for organising. Hierarchy works pretty well for about half my stuff (development work in particular). But notes and things I like to jot down often get lost on my disk -- there are multiple places that some things belong, and some belong nowhere at all.

I decided that a personal wiki would be the best way forward for this. However, I then had to choose a wiki -- thankfully the WikiMatrix helps a lot. I had tried the Instiki wiki. But it turns out that Ruby on Rails does suck as much as they say -- the instiki process would sit there at about 50Mb for a while, but then decide that it would use up all my memory. (Other people have noticed the same behaviour). So I wasted some time with that, and I don't think I'll be trying Ruby on Rails soon if this is the kind of thing I can expect.

But anyway, WikiMatrix helped me find the Trac wiki. Though I've used Trac a lot before, I hadn't thought of this option, as it is a wiki that is geared towards software projects, not general things. However, I've discovered it is ideal for me:

  • You can very easily turn off all the stuff you don't want, and then those components just disappear from the interface, exactly like they should.
  • It has all the help you need built in.
  • Nice GUI for administering it -- you need to use the command line UI for the first few steps, and you need to use htdigest to set up a password file, which some people might find tricky, but as a developer I'm right at home with that kind of thing.
  • It is written in Python, and it seems to be very well written too.
  • It uses SQlite (can use other databases), so it easy to query from outside if necessary.
  • It comes with a built in server -- very little setup, easy to run as a normal user.
  • It has a plugin architecture with lots of good plugins, and you can easily write your own.

This has allowed me to bring lots of bits and pieces into one place, and organise them as loosely or tightly as I want. The TagsPlugin for Trac makes this particularly convenient. The wiki is actually pretty nice for composing blog posts too -- it can do all the code highlighting I want, and I can just copy the output HTML into my blog when it's ready.

Combining wiki and desktop §

The final problem is integrating wiki and other files. Obviously, I have many documents that are much better managed outside a wiki. It would be nice to be able to refer to these easily. And by writing some Trac plugins, this is actually pretty easy. I can now write things like this:

  file:ID-bible-reading-schedule-pdf

in my wiki and it turns into a file:/// link to the right document. In Konqueror, this works really well -- right clicking on the link brings up the same context menu that I would get in file browsing mode, so everything is available to me right there from the wiki page. I can also do a search:

  [[MetaTrackerSearch(programming languages,web)]]

This will returns links to all files containing the text "programming languages" and "web", nicely formatted in a table. Or I can do a tag search like this:

  [[MetaTrackerTagSearch(sermon)]]

to return all my sermons.

Further §

I've created a very simple Trac plugin for creating KioSword links, which works nicely for embedding links to Bible passages. I've got some ideas for further integrating different parts of my desktop. One thing I'd like to do is produce a database of my sermons and bible studies, the texts they are on, when and where I've preached them etc. A private Django app using the Django admin would probably work exceedingly well, and be very little work. A simple export routine could produce a wiki page that could be 'included' into my wiki (using a Trac macro). It could also export an read only ICal file which can be displayed in Kontact. So many cool ideas, so little time...

  • tracker_tag_file
    Install this by putting it in your path somewhere (e.g. ~/bin, if that is on your PATH)
    It requires:
    • kdialog (present on all KDE installations)
    • setClipboard -- a little utility to set the clipboard with the contents of the tags just added, for convenience only, see below.

Comments §

blog comments powered by Disqus