The following was initially posted on, before I realised that this might benefit from a more preservable/visible format.

Frustrated with only interacting with my ownCloud calendar through the native web interface, I finally decided to look for a replacement application that I could run locally. Khal ended up being it, with vdirsyncer for two-way CalDAV sync with ownCloud.


Coupled with watdo, by the same author as vdirsyncer, for todo.txt-like management of CalDAV tasks (VTODO), I can now do all my schedule and tasks management from the comfort of my own terminal, even without any connectivity!

Configuring Khal and vdirsyncer

$ cat .khal/khal.conf

path = ~/.calendars/home/
color = dark blue

path = ~/.calendars/work/
color = dark green
$ cat .vdirsyncer/config
status_path = ~/.vdirsyncer/status/

[pair contacts]
a = contactslocal
b = contacts_remote
collections = ["from b"]
[storage contactslocal]
type = filesystem
path = ~/.contacts/
fileext = .vcf
[storage contacts_remote]
type = carddav
url = http://OWNCLOUD/remote.php/carddav/
username = USERNAME
password = PASSWORD

[pair calendar]
a = calendarlocal
b = calendar_remote
collections = ["from b"]
[storage calendarlocal]
type = filesystem
path = ~/.calendars/
fileext = .ics
[storage calendar_remote]
type = caldav
url = https://OWNCLOUD/remote.php/caldav/calendars/USERNAME/
username = USERNAME
password = PASSWORD

Note the collections = ["from b"] in vdirsyncer’s config section for the calendar pair just gets all the calendars from ownCloud, including the contact_birthdays one.

khalI find the parallel with Mutt/OfflineIMAP quite satisfying .

Vdirsyncer also syncs CardDAV entries, but I’m not sure what to do with them yet, as lbdb and pcquery (from pyCardDAV, from the author of Khal, fancy that!) do the job well from within Mutt.

$ grep pcquery -/.muttrc
set query_command="lbdbq '%s'; pcquery -m '%s' | sed 1d"

Todo management with watdo

This gets even better. ownCloud tasks can add VTODOs, and store them in the same CalDAV backend (at the time of this writing, oC 8 needs code from Git master). VTODOs naturally get synced by vdirsyncer along with the rest of the calendar entries, and can then be managed locally by watdo, which summarises them in a todo.txt format in your favourite $EDITOR.

$ cat .watdo/config 
path = ~/.calendars/

Now, my last wish on this matter is that GTG support an ICS or CalDAV backend.

Side bonus: PUT a local ICS file into the CalDAV server

I still need to find a way to pust ICS files I receive as attachment to emails into ownCloud. I suspect the basic idea is to wrap the following into a script (perhaps using the object’s UID as a more unique name on the server side.

curl -T ~/bdata.ics -u USERNAME https://OWNCLOUD/remote.php/caldav/calendars/USERNAME/work/bdata.ics


# A simple tool to add a flat ICal file to a remote CalDAV server
# Copyright (C) 2015 Olivier Mehani <>
# usage:
# FILE.ics
# cat FILE.ics |
# handy in Mutt:
# macro attach \ec "<pipe-entry>\n" "PUT ICal file into calendar"
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

if [[ -z "$1" ]]; then
 cat > $ICSNAME

OBJUID=`sed -n s/^UID://p $ICSNAME`

if [[ -z "$1" ]]; then


What would really make me completely happy is if the Hamster time tracker could use or sync with VJOURNAL entries (stored locally, of course!).

Update (2015-12-26)

Watdo is now deprecated in favour of todoman.

Updates (2016-05-16)

Comments are closed.