Recently I’ve been on a bit of a command line kick and I started using khal to render my calendar agenda locally.

All of the codebases used are python based so before I start I’ve created a virtualenv so as not to pollute my OS.

mkvirtualenv khal workon khal

Vdirsyncer

Firstly we need to setup Vdirsyncer, which is used to actually download your caldav entries to a local folder which khal then reads from.

pip install vdirsyncer

Then to configure it create a file in ~/.vdirsyncer/config and adding these contents, replacing the username/password with your own.

[[[[gspabcstuuprstpf##etaotyrsaetyaiepnai==loplesaoptlnoetrlrersdrehecsru""ea=nw_aeotasfkccg=aoog==xd_l_ahate"mrnetih]psali"hedl""noatl"occtykf~=gotm"naat==hi/khasllp=al."=i]ds""lev.==l=a:uO"]sdi"]v/sNtyicun"["/eErsrstu~"cr_uts"fl/fa@Teey-l.rlfI"mn8vodaM"c"dmasEeivt_rra.mP/s"maAfy,eiSanslSsc"s.WtefafOmrrgmRa/oi"Dismn"ltg"abet"nu]gsi/n"e.com/"

Then run an initial vdirsyncer command, this will create a bunch of folders under ~/.vdirsyncer/fastmail, each of these represents each of the calendars you have in fastmail.

Khal

pip install khal

Now to configure khal we create this file in ~/.config/khal/config with the contents, replace the folder_id_* with the actual foldernames in ~/.vdirsyncer/fastmail

[[[[[[[c[pt[pt[pt[pt[ptltdldladaytayeayaaybayoiaoaoletprtpvtpdtpitpcmtntnefheaheehemherheaeegegnavnitlffdtddu==e==t==n==h==eooaiaalls]d]rrtmtrt~d]~d]~d]~da~dmmeees]/i]/i]/i/iy/iaafft]].s.s.s.ss.sttooivcvcvcvc]vcrrmdodododo]do==mmeivivivivivaafrerererere%%ttosrsrsrsrsrHdryyyyy:/==mnnnnn%%acccccMm%%teeeee/ddrrrrr%//=/////Y%%fffffmm%aaaaa//dsssss%%/tttttYY%mmmmmmaaaaa%/iiiiiH%lllll:Y/////%DffffM%eooooHfllll:adddd%ueeeeMlrrrrt____iiiidddd____1233

Now if you run khal you should get a nice calendar view with an agenda next to it.

Aliases

To keep things simple I created an alias that allows me to pop into this virtualenv, sync my calendars and display khal whenever I need my calendars displayed.

alias khal='workon khal && vdirsyncer sync && khal'