comp.org.uk

Networking | Programming | Security | Linux | Computer Science | About

Manage your schedule from the command line with calcurse

If you want to manage your schedule from the command line then calcurse could work for you. It is a calendar and scheduling application for the Linux command line. calcurse helps you to keep track of events, appointments and everyday tasks. It reminds you of upcoming deadlines, is customisable, its data can be exported and it can be used with many different scripting languages.

As you can see from the video above, calcurse is very extensive. It supports different types of appointments and TODO items, including all-day events and recurring appointments.

You can also configure it how you want by changing colours and binding keys. It uses some vim keybindings to move around the interface but this can be changed to whatever you want.

calcurse allows you to pipe information directly to scripts so you can send details to a text file or across the internet via any medium you want (Twitter, Facebook, Email, etc. It also has an extensive notification system to remind you of your different commitments.

Exporting from calcurse

If you want to read your calendar or schedule from your mobile phone, logging into an SSH server and viewing a terminal app through a small screen can be quite cumbersome. Also, because calcurse is made with ncurses, it doesn’t adapt particularly well to a limited screen size. So instead, there are a few options available to you:

1. Mail yourself your schedule

As you’re working on the Linux command line, this is a relatively easy option. You can output the next 14 days of apppointments by typing:

calcurse -r14

So to mail yourself your schedule, you can type in:

calcurse -r14 | mail@youraddress.com

You could also set an alias with your shell as follows:

alias calmail="calcurse -r14 | mail mail@youraddress.com"

so that you can type in:

calmail

and have all your appointments sent to you.

You could also set up a crontab to email your schedule to you on a daily basis at 8am. To do this, open your crontab (Linux scheduler) and add the following lines to the bottom:

00 8 * * * * /usr/local/bin/calcurse -r14 | /usr/bin/mail mail@youraddress.com

2. Output to a web page

Another option for outputting our schedule from calcurse is by outputting to a web page. This has the advantages that it doesn’t clog up our inbox however you will need access to a web server for this option.

To output to a web page, we create a text document in the webspace of our server:

calcurse -r30 -t > /var/www/htdocs/calendar.txt

The previous command listed all appointments for the last 30 days. Obviously, this means that we need access to a web server on our machine to do this so this is a big limitation with this method.

3. Export an ical feed

The third method for exporting our calcurse diary is by creating an ical feed. This will allow you to create an ics file, store it on the internet and then either import it into your phone or another calendar such as Google Calendar or Microsoft Outlook. This is done by issuing the following command:

calcurse --export > calendar.ics

The benefit of this method is that you will get your full diary on your phone (or wherever you chose to put it). The downside is that it only works in one direction therefore any changes that you make in your calendar client will not feed back into calcurse.

4. Synchronise with a CalDAV server

The newest version of calcurse comes with calcurse-caldav – a simple Python script that can be used to synchronise calcurse with a CalDAV server. CalDAV is an Internet standard allowing a client to access scheduling information on a remote server. 

Using this method, will allow you two way synchronisation with your calcurse file, which is a great option however, at the time of writing, its still in an alpha release. You can find out more about how to do this on the calcurse-caldav web page.

As you can see, calcurse is a very extensive calendar and scheduling app for the Linux CLI. If you like the ncurses type display and having all your TODO items and calendar in one place then it could be just what you’re looking for. 

If not, why not take a look at when, gcal, cal, calendar, khal or any number of other Linux terminal calendar programs.


Published on Mon 24 December 2018 by Gary Hall in Linux with tag(s): calcurse command line