Tuesday, September 16, 2014

Install jrnl on Cygwin

I ran across jrnl the other day and thought "ooh, a command line journal, how cool is that??" Because ... well, command line. (If I could move my mouse and click from the command line, I probably would. Maybe a vim plugin....)

So this is how to install jrnl under Cygwin, because it was (slightly) non-obvious:

First, you need the Cygwin python package. If you don't have it, get it. I installed under python3.2 which is (currently) the latest version of python3; you're on your own if you install under python 2. (Aside: the Windows version of python and the Cygwin shell do not get along very well; don't even bother trying this with Windows python.)

Next you'll need pip, the Python installer. Download the installation script at http://pip.readthedocs.org/en/latest/installing.html and then run e.g. "~/Downloads/get-pip.py". (My download directory is ~/Downloads.)

Once pip is working, run "pip install jrnl". You'll see pip do its thing, and a few moments later jrnl will be installed.

Last, you'll need to edit /usr/lib/python3.2/site-packages/jrnl/util.py. Go to line 130 and remove the leading 'u' from the string. Until you do this, running jrnl will result in a traceback and abend. For reference in case it moves, that line is:

return u"\033[36m{}\033[39m".format(string)

(I'm not a Pythonista but apparently Python doesn't support the leading 'u' for Unicode strings anymore.)

The default journal will be created as ~/journal.txt and the jrnl configuration file is in ~/.jrnl-config. Happy journaling!