My funky Pythony Unix GtD system

Back in December, I talked about PyGTD and mentioned that I’d been messing around with my own homebrew system.

To be honest, I haven’t been using it regularly lately (self-flagellation), but a few people have asked about it, so I thought I’d post about it in case people find any of it useful.

The idea was to build something with the following goals in mind:

  • Works on the Unix command-line as it’s cross-platform and something I’m very comfortable with and spend a lot of time in as part of my work. In fact, since I’m a programmer, a terminal is where I spend most of my time working and so it’s natural to have a system that works in a terminal, rather than once that forces me to use an email program, outliner, web browser, etc. That would be a distraction and would take me out of the environment in which I am productive.
  • As freeform and text-based as possible. Text is totally extensible and can me made to do anything. Overly structured stuff can be very limiting. Another benefit of text is that it allows the use of tons of tools – grep, sed, perl, python, etc. and you can backup your data with standard stuff like tar, rsync, unison, etc.
  • Built with the Unix philosophy of stringing together simple tools so it’s easily malleable and extensible.
  • I wanted to build something with Python or Ruby (rather than, say, Perl), because I was interested in exploring those languages a bit.
  • Simple to use – PyGTD was too complex for me

Well what developed out of these goals was a weird combination of file system conventions, off the shelf tools, and a custom Python script. Maybe it’s too weird for anyone but me, or maybe not – a few folks have asked about it. Even if you don’t use it verbatim, you might copy some ideas from it.

So the idea is to represent projects, next actions, and waiting fors in the filesystem. These things can all be represented by directories. Directories can represent projects which can contain arbitrary levels of subprojects which contain next actions and waiting fors. Projects, subprojects, and tasks have a hierarchy to them and so do directories so it’s a match made in heaven.

Furthermore, it’s easy to display these hierarchical directory structures with a tool called tree (in order to build tree-1.5.0 on OS X, I had to make some patches). I also use this alias: alias tree='tree -A --noreport'

Using tree, it’s easy to get a nice overview of any part of your “GtD tree”:

+-- hobbies
|   +-- geek_stuff
|   |   +-- desktop_pc
|   |   |   +-- install_dvd_burner
|   |   |   +-- setup_new_powerstrip
|   |   +-- firefox plugins
|   |       +-- rev sidebar plugin
|   +-- music
|       +-- jam with Brian

The other key element of GtD is contexts which in my system I represent as files (dot files you’ll see soon so that they’re hidden and don’t clutter the display) in the directories. Interestingly, using files lets you have multiple contexts for a task – in a sense, it’s like a tagging system. This is kind of an interesting twist on the traditional GtD concept of contexts, because you can mark your tasks with multiple tags with names of peoples, places, etc. For example, I can mark a waiting for with a “wait” tag as well as a tag with the name of the person who I’m waiting for.

In order to search for items that match the various tags, I use a very simple gtd Python script. It’s a simple little script that uses Python’s os.walk function to walk through your directory tree and find tasks that match criteria, typically tasks (directories) that have a tag (file) that you specify. It’s Python so if you don’t like it, change it.

The last piece of it is that I’ve linked it all together with a neat little curses-based directory navigation utility called cdargs. It’s a nice utility for displaying all the tasks that match a tag that I specify to my Python script and then navigating to that directory.

In order to link gtd.py and cdargs, I use this little bash function:

gtd () 
{ 
    ~/bin/gtd.py "$@" >/tmp/gtd.cdargs && cdargs -f /tmp/gtd.cdargs && cd `cat ~/.cdargsresult`
}

It’s just a silly function that calls gtd.py with the args I specify, takes the result and feeds them to cdargs and then has bash change to the directory that I pick in cdargs.

OK, it’s not exactly turnkey and it’s pretty fricking weird, but hey, you guys asked. 🙂

One thought on “My funky Pythony Unix GtD system

  1. For implementing GTD you might try out this new web-based application:

    http://www.gtdagenda.com

    You can use it to manage your goals, projects and tasks, set next actions and contexts, use checklists, schedules and a calendar.
    A mobile version and iCal are available too.

    Hope you like it.

Leave a Reply

Your email address will not be published. Required fields are marked *