Calcurse, a useful calendar for the commandline in Gnu/Linux

in #linuxlast year

Calcurse the commandline calender program.

Any other people preferring command line apps over bulky gui apps,
would probably like to use calcurse, it offers a very simple UI for
interactions with your calendar, gives a good overview and allows you
to have a todo list besides your calendar.

It is very simple to add a new event to the calendar, just navigate to
the day you want to add the event for and push a to add the event,
then the program will ask for time and end time, and a title for the
event. Do remember to save the event by pushing s, otherwise it
will not be saved. This is all well and good but if the program do no
more than show your calendar it is hardly very good, but then calcurse
has a few tricks up its sleeves. There is the fact that it can export
to ical, which is the default format for most calendars, and this
makes it fairly nice to have your calendar in calcurse.

But what about sync'ing with your phone ?

This can be done with a little help from another tool I will be
introducing in a post soon, called syncthing I will not write all
that much about syncthing right now, but it allows you to sync things
without using a server, so direct transfer between devices. Even with
this tool it would be somewhat difficult to sync calcurse with
anything, but now we get to the real power of calcurse, since you can
define what it does before saving and after saving (same with load),
and this with all the power of the unix shell. I utilize this for a
very simple thing, exporting my calendar to the folder syncthing syncs
with my phone. That way I have the same calendar in more than one
place, though I have not automated the importing of the file on my
phone as of yet.

Now I want to show how you can do some powerful things with calcurse,
through a little bit of scripting

~/.config/calcurse/hooks/

This is the folder where calcurse keeps its scripts to that will be
used when you save or load, there can be 4 files pre-load,
post-load, pre-save, and post-save
, these are used either in the
loading of the saved calendar, or the saving of the calendar. I use
post-save to export the calendar and cp it to the folder
syncthing is looking in.

My file looks like this.

calcurse --export=ical > ~/appointments/calendar.ical

a single line to export and write to the desired location. I would
with benefit be able to use pre-load to import any changes to this
calendar as well.