caldr
, the command line calendar. It's super lightweight, yet it
supports CardDAV sync!
go build .
Either export all necessary variables to your ENV or set them as command line flags:
export CARDDAV_USERNAME='...'
export CARDDAV_PASSWORD='...'
export CARDDAV_ENDPOINT='...'
export CALDR_DB='...'
If you're using Baïkal for example, you
would export something like this as CARDDAV_ENDPOINT
:
export CARDDAV_ENDPOINT='https://my.baik.al/dav.php/'
The CALDR_DB
is the local events database in order to not need to contact
the CalDAV for every lookup. You might set it to something like this:
export CALDR_DB=~/.cache/caldr.db
When caldr
is launched for the first time, it requires the -r
flag to
refresh the events and sync them locally:
caldr -r
This way you could create a cron job that refreshes caldr
in the background,
e.g. every three hours:
crontab -e
0 */3 * * * sh -c 'caldr -r'
You can also output contacts as JSON format using the -j
flag:
caldr -j
Find more flags and info with caldr --help
.
You can customize the regular output using templating. The template can either
be passed using the --template <file>
flag or by exporting CALDR_TEMPLATE
in the in the environment.
The templating format is the Go standard text/template
format.
Available property names that are available can be found by checking the
CalEvent
struct in store/store.go
.
An example template can be found here. To make use of the template, you can
copy it to e.g. ~/.config/caldr.tmpl
and have
CALDR_TEMPLATE=~/.config/caldr.tmpl
exported in your .zshrc
/.bashrc
/etc.
Check my dotfiles, especially this script for how to get notifications for events. You could either run this script on login or periodically as a cron job.
caldr
write/modify any contact information?caldr
only supports CalDAV servers to sync with.text/template
stuff doesn't work for me, can I make caldr
output-j
flag and have it output pure JSON, which you canjq
.