4. calcurse basics

4.1. Invocation

Command line arguments

calcurse takes the following options from the command line (both short and long options are supported):

-a, --appointment
Print the appointments and events for the current day and exit. The calendar from which to read the appointments can be specified using the -c flag.
-c <file>, --calendar <file>
Specify the calendar file to use. The default calendar is ~/.calcurse/apts (see section calcurse files). This option has precedence over -D.
-d <date|num>, --day <date|num>

Print the appointments for the given date or for the given number of upcoming days, depending on the argument format. Two possible formats are supported:

  • a date (possible formats described below).
  • a number n.

In the first case, the appointment list for the specified date will be returned, while in the second case the appointment list for the n upcoming days will be returned. As an example, typing calcurse -d 3 will display your appointments for today, tomorrow, and the day after tomorrow. Possible formats for specifying the date are defined inside the general configuration menu (see General options), using the format.inputdate variable.

Note: as for the -a flag, the calendar from which to read the appointments can be specified using the -c flag.

-D <dir>, --directory <dir>
Specify the data directory to use. If not specified, the default directory is ~/.calcurse/.
--format-apt <format>
Specify a format to control the output of appointments in non-interactive mode. See the Format strings section for detailed information on format strings.
--format-recur-apt <format>
Specify a format to control the output of recurrent appointments in non-interactive mode. See the Format strings section for detailed information on format strings.
--format-event <format>
Specify a format to control the output of events in non-interactive mode. See the Format strings section for detailed information on format strings.
--format-recur-event <format>
Specify a format to control the output of recurrent events in non-interactive mode. See the Format strings section for detailed information on format strings.
--format-todo <format>
Specify a format to control the output of todo items in non-interactive mode. See the Format strings section for detailed information on format strings.
-g, --gc
Run the garbage collector for note files and exit.
-h, --help
Print a short help text describing the supported command-line options, and exit.
-i <file>, --import <file>
Import the icalendar data contained in file.
-l <num>, --limit <num>
Limit the number of results printed to num.
-n, --next

Print the next appointment within upcoming 24 hours and exit. The indicated time is the number of hours and minutes left before this appointment.

Note: the calendar from which to read the appointments can be specified using the -c flag.

-r[num], --range[=num]
Print events and appointments for the num number of days and exit. If no num is given, a range of 1 day is considered.
--read-only

Don’t save configuration nor appointments/todos.

Warning

Use this this with care! If you run an interactive calcurse instance in read-only mode, all changes from this session will be lost without warning!

-s[date], --startday[=date]
Print events and appointments from date and exit. If no date is given, the current day is considered.
-S<regex>, --search=<regex>
When used with the -a, -d, -r, -s, or -t flag, print only the items having a description that matches the given regular expression.
--status
Display the status of running instances of calcurse. If calcurse is running, this will tell if the interactive mode was launched or if calcurse is running in background. The process pid will also be indicated.
-t[num], --todo[=num]
Print the todo list and exit. If the optional number num is given, then only todos having a priority equal to num will be returned. The priority number must be between 1 (highest) and 9 (lowest). It is also possible to specify 0 for the priority, in which case only completed tasks will be shown.
-v, --version
Display calcurse version and exit.
-x[format], --export[=format]

Export user data to specified format. Events, appointments and todos are converted and echoed to stdout. Two possible formats are available: ical and pcal (see section Links below). If the optional argument format is not given, ical format is selected by default.

Note: redirect standard output to export data to a file, by issuing a command such as:

$ calcurse --export > my_data.dat

Note

The -N option has been removed in calcurse 3.0.0. See the Format strings section on how to print note along with appointments and events.

Format strings

Format strings are composed of printf()-style format specifiers — ordinary characters are copied to stdout without modification. Each specifier is introduced by a % and is followed by a character which specifies the field to print. The set of available fields depends on the item type.

Format specifiers for appointments
s
Print the start time of the appointment as UNIX time stamp
S
Print the start time of the appointment using the hh:mm format
d
Print the duration of the appointment in seconds
e
Print the end time of the appointment as UNIX time stamp
E
Print the end time of the appointment using the hh:mm format
m
Print the description of the item
n
Print the name of the note file belonging to the item
N
Print the note belonging to the item
Format specifiers for events
m
Print the description of the item
n
Print the name of the note file belonging to the item
N
Print the note belonging to the item
Format specifiers for todo items
p
Print the priority of the item
m
Print the description of the item
n
Print the name of the note file belonging to the item
N
Print the note belonging to the item
Examples
calcurse -r7 --format-apt='- %S -> %E\n\t%m\n%N'
Print appointments and events for the next seven days. Also, print the notes attached to each regular appointment (simulates -N for appointments).
calcurse -r7 --format-apt=' - %m (%S to %E)\n' --format-recur-apt=' - %m (%S to %E)\n'
Print appointments and events for the next seven days and use a custom format for (recurrent) appointments: ` - Some appointment (18:30 to 21:30)`.
calcurse -t --format-todo '(%p) %m\n'
List all todo items and put parentheses around the priority specifiers.
Extended format specifiers

Extended format specifiers can be used if you want to specify advanced formatting options. Extended specifiers are introduced by %( and are terminated by a closing parenthesis ()). The following list includes all short specifiers and corresponding long options:

  • s: (start)
  • S: (start:epoch)
  • e: (end)
  • E: (end:epoch)
  • d: (duration)
  • r: (remaining)
  • m: (message)
  • n: (noteid)
  • N: (note)
  • p: (priority)

The (start) and (end) specifiers support strftime()-style extended formatting options that can be used for fine-grained formatting. Additionally, the special formats epoch (which is equivalent to (start:%s) or (end:%s)) and default (which is mostly equivalent to (start:%H:%M) or (end:%H:%M) but displays ..:.. if the item doesn’t start/end at the current day) are supported.

The (remaining) and (duration) specifiers support a subset of the strftime()-style formatting options, along with two extra qualifiers. The supported options are %d, %H, %M and %S, and by default each of these is zero-padded to two decimal places. To avoid the zero-padding, add - before the formatting option (for example, %-d). Additionally, the E option will display the total number of time units until the appointment, rather than showing the remaining number of time units modulo the next larger time unit. For example, an appointment in 50 hours will show as 02:00 with the formatting string %H:%M, but will show 50:00 with the formatting string %EH:%M. Note that if you are combining the - and E options, the - must come first. The default format for the (remaining) specifier is %EH:%M.

Environment variable for i18n

calcurse can be compiled with native language support (see gettext library). Thus, if you wish to have messages displayed into your native language, first make sure it is available by looking at the po/LINGUAS file. This file indicates the set of available languages by showing the two-letters corresponding code (for exemple, fr stands for french). If you do not find your language, it would be greatly appreciated if you could help translating calcurse (see the How to contribute? section).

If your language is available, run calcurse with the following command:

$ LC_ALL=fr_FR calcurse
  1. where fr_FR is the locale name in this exemple, but should be replaced by the locale corresponding to the desired language.

You should also specify the charset to be used, because in some cases the accents and such are not displayed correctly. This charset is indicated at the beginning of the po file corresponding to the desired language. For instance, you can see in the fr.po file that it uses the iso-8859-1 charset, so you could run calcurse using the following command:

$ LC_ALL=fr_FR.ISO8859-1 calcurse

Other environment variables

The following environment variables affect the way calcurse operates:

VISUAL
Specifies the external editor to use for writing notes.
EDITOR
If the VISUAL environment variable is not set, then EDITOR will be used as the default external editor. If none of those variables are set, then /usr/bin/vi is used instead.
PAGER
Specifies the default viewer to be used for reading notes. If this variable is not set, then /usr/bin/less is used.

4.2. User interface

Non-interactive mode

When called with at least one of the following arguments: -a, -d, -h, -n, -t, -v, -x, calcurse is started in non-interactive mode. This means the desired information will be displayed, and after that, calcurse simply quits and you are driven back to the shell prompt.

That way, one can add a line such as calcurse --todo --appointment in its init config file to display at logon the list of tasks and appointments scheduled for the current day.

Interactive mode

Note

Key bindings that are indicated in this manual correspond to the default ones, defined when calcurse is launched for the first time. If those key bindings do not suit user’s needs, it is possible to change them within the keys configuration menu (see key bindings).

When called without any argument or only with the -c option, calcurse is started in interactive mode. In this mode, you are shown an interface containing three different panels which you can browse using the TAB key, plus a notification bar and a status bar (see figure below).

 appointment panel---.                                   .---calendar panel
                     |                                   |
                     v                                   v
 +------------------------------------++----------------------------+
 |          Appointments              ||          Calendar          |
 |------------------------------------||----------------------------|
 |                 (|)  April 6, 2006 ||         April 2006         |
 |                                    ||Mon Tue Wed Thu Fri Sat Sun |
 |                                    ||                      1   2 |
 |                                    ||  3   4   5   6   7   8   9 |
 |                                    || 10  11  12  13  14  15  16 |
 |                                    || 17  18  19  20  21  22  23 |
 |                                    || 24  25  26  27  28  29  30 |
 |                                    ||                            |
 |                                    |+----------------------------+
 |                                    |+----------------------------+
 |                                    ||            ToDo            | todo
 |                                    ||----------------------------| panel
 |                                    ||                            |   |
 |                                    ||                            |   |
 |                                    ||                            |<--.
 |                                    ||                            |
 +------------------------------------++----------------------------+
 |---[ Mon 2006-11-22 | 10:11:43 ]---(apts)----> 01:20 :: lunch <---|<--.
 +------------------------------------------------------------------+ notify-bar
 | ? Help     R Redraw    H/L -/+1 Day      G GoTo       C Config   |
 | Q Quit     S Save      J/K -/+1 Week   Tab Chg View              |<-.
 +------------------------------------------------------------------+  |
                                                                       |
                                                                 status bar

The first panel represents a calendar which allows to highlight a particular day, the second one contains the list of the events and appointments on that day, and the last one contains a list of tasks to do but which are not assigned to any specific day.

Depending on the selected view, the calendar could either display a monthly (default as shown in previous figure) or weekly view. The weekly view would look like the following:

+------------------------------------+
|              Calendar              |
|----------------------------(# 13)--|
|    Mon Tue Wed Thu Fri Sat Sun     |
|     29  30  31  01  02  03  04     |
|                               <----+--  slice 1: 00:00 to 04:00 AM
|       --  --  --  --  --  --       |
|                               <----+--  slice 2: 04:00 to 08:00 AM
|       --  --  --  --  --  --       |
|                               <----+--  slice 3: 08:00 to 12:00 AM
|    -  --  --  --  --  --  --  -  <-+--  midday
|                               <----+--  slice 4: 12:00 to 04:00 PM
|       --  --  --  --  --  --       |
|                               <----+--  slice 5: 04:00 to 08:00 PM
|       --  --  --  --  --  --       |
|                               <----+--  slice 6: 08:00 to 12:00 PM
+------------------------------------+

The current week number is displayed on the top-right side of the panel (# 13 meaning it is the 13th week of the year in the above example). The seven days of the current week are displayed in column. Each day is divided into slices of 4 hours each (6 slices in total, see figure above). A slice will appear in a different color if an appointment falls into the corresponding time-slot.

In the appointment panel, one can notice the (|) sign just in front of the date. This indicates the current phase of the moon. Depending on which is the current phase, the following signs can be seen:

` |) `
first quarter
` (|) `
full moon
` (| `
last quarter
` | `
new moon
no sign
Phase of the moon does not correspond to any of the above ones.

At the very bottom of the screen there is a status bar, which indicates the possible actions and the corresponding keystrokes.

Just above this status bar is the notify-bar, which indicates from left to right : the current date, the current time, the calendar file currently in use (apts on the above example, which is the default calendar file, see the following section), and the next appointment within the upcoming 24 hours. Here it says that it will be lunch time in one hour and twenty minutes.

Note

Some actions, such as editing or adding an item, require to type in some text. This is done with the help of the built-in input line editor.

Within this editor, if a line is longer than the screen width, a >, *, or < character is displayed in the last column indicating that there are more character after, before and after, or before the current position, respectively. The line is scrolled horizontally as necessary.

Moreover, some editing commands are bound to particular control characters. Hereafter are indicated the available editing commands (^ stands for the control key):

^a
moves the cursor to the beginning of the input line
^b
moves the cursor backward
^d
deletes one character forward
^e
moves the cursor to the end of the input line
^f
moves the cursor forward
^h
deletes one character backward
^k
deletes the input from the cursor to the end of the line
^w
deletes backward to the beginning of the current word
ESCAPE
cancels the editing

4.3. Background mode

When the daemon mode is enabled in the notification configuration menu (see Notify-bar settings), calcurse will stay in background when the user interface is not running. In background mode, calcurse checks for upcoming appointments and runs the user-defined notification command when necessary. When the user interface is started again, the daemon automatically stops.

‘calcurse` background activity can be logged (set the daemon.log variable in the notification configuration menu), and in that case, information about the daemon start and stop time, reminders’ command launch time, signals received… will be written in the daemon.log file (see section files).

Using the --status command line option (see section Command line arguments), one can know if calcurse is currently running in background or not. If the daemon is running, a message like the following one will be displayed (the pid of the daemon process will be shown):

calcurse is running in background (pid 14536)

Note

To stop the daemon, just send the TERM signal to it, using a command such as: kill daemon_pid, where daemon_pid is the process id of the daemon (14536 in the above example).

4.4. calcurse files

The following structure is created in your $HOME directory (or in the directory you specified with the -D option) the first time calcurse is run :

$HOME/.calcurse/
           |___notes/
           |___conf
           |___keys
           |___apts
           |___todo
notes/
this subdirectory contains descriptions of the notes which are attached to appointments, events or todos. Since the file name of each note file is a SHA1 hash of the note itself, multiple items can share the same note file. calcurse provides a garbage collector (see the -g command line parameter) that can be used to remove note files which are no longer linked to any item.
conf
this file contains the user configuration
keys
this file contains the user-defined key bindings
apts
this file contains all of the events and user’s appointments
todo
this file contains the todo list

Note

If the logging of calcurse daemon activity was set in the notification configuration menu, the extra file daemon.log will appear in calcurse data directory. This file contains logs about calcurse activity when running in background.

4.5. Import/Export capabilities

The import and export capabilities offered by calcurse are described below.

Import

Data in icalendar format as described in the rfc2445 specification (see links section below) can be imported into calcurse. Calcurse ical parser is based on version 2.0 of this specification, but for now on, only a subset of it is supported.

The following icalendar properties are handled by calcurse:

  • VTODO items: "PRIORITY", "VALARM", "SUMMARY", "DESCRIPTION"
  • VEVENT items: "DTSTART", "DTEND", "DURATION", "RRULE", "EXDATE", "VALARM", "SUMMARY", "DESCRIPTION"

The icalendar DESCRIPTION property will be converted into calcurse format by adding a note to the item. If a "VALARM" property is found, the item will be flagged as important and the user will get a notification (this is only applicable to appointments).

Here are the properties that are not implemented:

  • negative time durations are not taken into account (item is skipped)
  • some recurence frequences are not recognize: "SECONDLY" / "MINUTELY" / "HOURLY"
  • some recurrence keywords are not recognized (all those starting with BY): "BYSECOND" / "BYMINUTE" / "BYHOUR" / "BYDAY" / "BYMONTHDAY" / "BYYEARDAY" / "BYWEEKNO" / "BYMONTH" / "BYSETPOS" plus "WKST"
  • the recurrence exception keyword "EXRULE" is not recognized
  • timezones are not taken into account

Export

Two possible export formats are available: ical and pcal (see section Links below to find out about those formats).

4.6. Online help

At any time, the built-in help system can be invoked by pressing the ? key. By default, it shows an introduction to the help system in an external pager. You need to exit the pager in order to get back to calcurse (pressing q should almost always work). The default pager can be changed by setting the PAGER environment variable.

If you want to display help on a specific feature or key binding, type :help <feature> (e.g. :help add) or :help <key> (e.g. :help ^A) on the main screen.