Friday, February 18, 2011

Minimalistic to-do

Last month while browsing on net, I found blog post on how to create minimalist to-do list in bash shell. Code was simple, 3 lines in .bash_profile. Since I day spend considerable amount of time in iTerm2 (alternative to Terminal app on Mac OS X) and I hardly close iTerm2, I thought to give it a try and see how it works out for me. After using for around a month, I'm finding it easier to manage my to-do list. And with help of Dropbox on Mac and PlainText app on iPhone, I'm able to sync list between my Mac and iPhone. Unfortunately I lost the link to blog post, so pasting code here.

Add following in .bash_profile
# Todo start
# Store in PlainText iPhone app folder in Dropbox for sync
export TODO=~/Dropbox/PlainText/todo.txt
function todo() { if [ $# == "0" ]; then cat $TODO; else echo "* $@" >> $TODO; fi }
function todone() { sed -i "" -e "/$*/d" $TODO; }

Reload profile
$ source .bash_profile

Add task to to-do list
$ todo write test case of bug #345
$ todo refactor worker class
$ todo check 280slides.com

Display to-do list
$ todo
* write test case of bug #345
* refactor worker class
* check 280slides.com

Remove task from to-do
$ todone refactor

To remove to-do item, only part of description is required. This might sometime get messy if list is long, but hey, isn't goal is to keep getting things done in to-do list and try to keep it as small as possible?

I also used GeekTool to display to-do list on my desktop on second monitor.

No comments:

Post a Comment