Todo-txt: Setting up in Ubuntu


Today, I’m Setting up todo-txt today into my Ubuntu, using the repository version which now exists in every major distro to my great satisfaction!

Todo-txt is a fantastic set of scripts which allow you to manage your todo-list write from the terminal.

It is very easy to setup todo-txt by using the site documentation at http://www.todotxt.org but the same instructions can get a bit confusing if you install it using the repository installation.

I found the repository installation easier and faster, so I think it was worth the effort to write a detailed installation tutorial.

So the first thing to do is to install todo-txt:

sudo apt-get install todo-txt

After that, you need to copy the default configuration file from /etc/todo-txt to a new created directory into your home folder (.todo-txt)

sudo cp /etc/todo-txt/config ~/.todo-txt/

Then you need to change the owner of the config file to your username:

sudo chown myname ~/.todo-txt/config

Next step is to tell todo-txt where your files will reside. Edit the config file:

nano ~/.todo-txt/config

and change this line to your desired directory:

export TODO_DIR=~/todo_files

Additionally, I like to have my todos sorted by priority first so I add the line to the end of the config:

export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -k 2,2 -k 1,1n’

The final step is to make some changes to the ~/.bashrc file to make things easier. I add those lines:

export TODOTXT_DEFAULT_ACTION=ls alias t="todo-txt -t”

Now you can type t in any terminal window and get a list of your tasks by priority. Add any command after the t to tell todo-txt what you want it to do (eg. t add My first task @pc). The -t flag ensures that new tasks will get the creation date.

One other change I had to make was to make the bash completion script executable by calling


sudo chmod +x /usr/share/bash-completion/completions/todo-txt

This is why the completion didn’t work right after setting it up.


That’s all! I hope you will find it easy and useful like I did.