KHAL(1)
π KHAL(1) β khal π
β¨ NAME β¨
khal β khal Documentation
Okay bestie, khal is a calendar program for the terminal for viewing, adding and editing events and calendars. Itβs built on the iCalendar and vdir standards (so yes, you can use vdirsyncer(1) for CalDAV compatibility). π
πΈ USAGE πΈ
Khal offers a set of commands, most importantly list, calendar, interactive, new, printcalendars, printformats, and search. See below for a description of what every command does.
One thing to know: khal does currently not support any default command, i.e., run a command, even though none has been specified. This is intentional. No cap.
β¨ Options β¨
khal (without any commands) has some options to print some information about khal:
--versionβ Prints khalβs version number and exits.-h,--helpβ Prints a summary of khalβs options and commands and then exits.
Several options are common to almost all of khalβs commands (exceptions are described below):
-v,--verbosity LVLβ Configure verbosity (e.g. print debugging information).LVLneeds to be one ofCRITICAL,ERROR,WARNING,INFO, orDEBUG.-l,--logfile LOFILEβ Use logfileLOGFILEfor logging, default is logging to stdout.-c CONFIGFILEβ Use an alternate configuration file.-a CALENDARβ Specify a calendar to use (which must be configured in the configuration file), can be used several times. Calendars not specified will be disregarded for this run.-d CALENDARβ Specify a calendar which will be disregarded for this run, can be used several times.--color/--no-colorβ khal will detect if standard output is not a tty, e.g., you redirect khalβs output into a file, and if so remove all highlighting/coloring from its output. Use--colorif you want to force highlighting/coloring and--no-colorif you want coloring always removed.--format FORMATβ For all of khalβs commands that print events, the formatting of that event can be specified with this option.FORMATis a template string, in which identifiers delimited by curly braces ({}) will be expanded to an eventβs properties.FORMATsupports all formatting options offered by pythonβsstr.format()(docs:https://docs.python.org/3/library/string.html#formatstrings) (as it is used internally). The available template options are:titleβ The title of the event.descriptionβ The description of the event.description-separatorβ A separator:" :: "that appears when there is a description.uidβ The UID of the event.startβ The start datetime in datetimeformat.start-longβ The start datetime in longdatetimeformat.start-dateβ The start date in dateformat.start-date-longβ The start date in longdateformat.start-timeβ The start time in timeformat.endβ The end datetime in datetimeformat.end-longβ The end datetime in longdatetimeformat.end-dateβ The end date in dateformat.end-date-longβ The end date in longdateformat.end-timeβ The end time in timeformat.repeat-symbolβ A repeating symbol (loop arrow) if the event is repeating.alarm-symbolβ An alarm symbol (alarm clock) if the event has at least one alarm.alarms-listβ A comma-separated list of alarms for the event (e.g.,alarm1@-15m,getready@-1h).locationβ The event location.calendarβ The calendar name.calendar-colorβ Changes the output color to the calendarβs color.start-styleβ The start time in timeformat OR an appropriate symbol.to-styleβ A hyphen"-"or nothing such that it appropriately fits between start-style and end-style.end-styleβ The end time in timeformat OR an appropriate symbol.start-end-time-styleβ A concatenation of start-style, to-style, and end-style OR an appropriate symbol.end-necessaryβ For an allday event this is an empty string unless the end date and start date are different. For a non-allday event this will show the time or the datetime if the event start and end date are different.end-necessary-longβ Same as end-necessary but uses datelong and datetimelong.statusβ The status of the event (if this event has one), something likeCONFIRMEDorCANCELLED.status-symbolβ The status of the event as a symbol, β or β or ?.partstat-symbolβ The participation status of the event as a symbol, β or β or ?.
cancelledβ The stringCANCELLED(plus one blank) if the eventβs status is cancelled, otherwise nothing.organizerβ The organizer of the event. If the format hasCNthen it returns"CN (email)"ifCNdoes not exist it returns just the email string. Example:ORGANIZER;CN=Name Surname:mailto:name@mail.comreturnsName Surname (name@mail.com)and if it has no CN attribute it returns the last element after the colon:ORGANIZER;SENT-BY="mailto:toemail@mail.com":mailto:name@mail.comreturnsname@mail.comurlβ The URL embedded in the event, otherwise nothing.url-separatorβ A separator:" :: "that appears when there is a url.durationβ The duration of the event in terms of days, hours, months, and seconds (abbreviated tod,h,m, andsrespectively).repeat-patternβ The raw iCal recurrence rule if the event is repeating.all-dayβ A boolean indicating whether it is an all-day event or not.categoriesβ The categories of the event.
By default, all-day events have no times. To see a start and end time anyway simply add -full to the end of any template with start/end or duration, for instance start-time becomes start-time-full and will always show start and end times (instead of being empty for all-day events).
In addition, there are colors: black, red, green, yellow, blue, magenta, cyan, white (and their bold versions: red-bold, etc.). There is also reset, which clears the styling, and bold, which is the normal bold.
A few control codes are exposed. You can access newline (nl), tab, and bell. Control codes, such as nl, are best used with --list mode.
Below is an example command which prints the title and description of all events today.
khal list --format "{title} {description}"
--json FIELD ...β Works similar to--format, but instead of defining a format string a JSON object is created for each specified field. The matching events are collected into a JSON array. This option accepts the following subset of--formattemplate options:
title, description, uid, start, start-long, start-date,
start-date-long, start-time, end, end-long, end-date,
end-date-long, end-time, start-full, start-long-full,
start-date-full, start-date-long-full, start-time-full,
end-full, end-long-full, end-date-full, end-date-long-full,
end-time-full, repeat-symbol, alarms-list, location, calendar,
calendar-color, start-style, to-style, end-style,
start-end-time-style, end-necessary, end-necessary-long,
status, cancelled, organizer, url, duration, duration-full,
repeat-pattern, all-day, categories
Note that calendar-color will be the actual color name rather than the ANSI color code, and the repeat-symbol, status, and cancelled values will have leading/trailing whitespace stripped. Additionally, if only the special value all is specified then all fields will be enabled.
Below is an example command which prints a JSON list of objects containing the title and description of all events today.
khal list --json title --json description
--day-format DAYFORMATβ works similar to--format, but for day headings. It only has a few options (in addition to all the color options):dateβ The date in dateformat.date-longβ The date in longdateformat.nameβ The dateβs name (Monday, Tuesday,β¦) or today or tomorrow.
If the --day-format is passed an empty string then it will not print the day headers (for an empty line pass in a whitespace character).
π¦ dates π¦
Almost everywhere khal accepts dates, khal should recognize relative date names like today, tomorrow and the names of the days of the week (also in three letters abbreviated form). Week day names get interpreted as the date of the next occurrence of a day with that name. The name of the current day gets interpreted as that date next week (i.e. seven days from now).
If a short datetime format is used (no year is given), khal will interpret the date to be in the future. The inferred it might be in the next year if the given date has already passed in the current year.
π Commands π
π list π
shows all events scheduled for a given date (or datetime) range, with custom formatting:
khal list [-a CALENDAR ... | -d CALENDAR ...]
[--format FORMAT] [--json FIELD ...] [--day-format DAYFORMAT]
[--once] [--notstarted] [START [END | DELTA] ]
Okay so, back to the deets on START and END β both can be given as dates, datetimes, or times (and if you only give a time, itβs assumed you mean today, bestie) in the formats configured in the configuration file. If END is not given, midnight of the start date is assumed. Today is used for START if itβs not explicitly given. If DELTA β a (date)time range in the format I{m,h,d}, where I is an integer and m means minutes, h means hours, and d means days β is given, END is assumed to be START + DELTA. A value of eod is also accepted as DELTA and means the end of day of the start date. In addition, the DELTA week may be used to specify that the daterange should actually be the week containing the START.
The --once option only allows events to appear once even if they are on multiple days. With the --notstarted option only events are shown that start after START.
β¨ Some examples β¨
Including or excluding specific calendars:
khal list -d soccerwill display events, in list form, from every calendar except "soccer."khal list -a soccerwill display events, in list form, from only the "soccer" calendar.
Working with date ranges:
khal list -a soccer today 30dwill show all events in next 30 days (from the "soccer" calendar).khal list 2019-12-01 31dwill show all all events for the 31 days following Dec 1, 2019.
π°οΈ at π°οΈ
Shows all events scheduled for a given datetime. khal at should be supplied with a date and time, a time (the date is then assumed to be today), or the string now. at defaults to now. The at command works just like the list command, except it has an implicit end time of zero minutes after the start.
khal at [-a CALENDAR ... | -d CALENDAR ...]
[--format FORMAT] [--json FIELD ...]
[--notstarted] [[START DATE] TIME | now]
π calendar π
Shows a calendar (similar to cal(1)) and list. khal calendar should understand the following syntax:
khal calendar [-a CALENDAR ... | -d CALENDAR ...] [START DATETIME]
[END DATETIME]
Date selection works exactly as for khal list. The displayed calendar contains three consecutive months, where the first month is the month containing the first given date. If today is included, it is highlighted. Have a look at khal list for a description of the options.
π configure π
Will help users creating an initial configuration file. configure will refuse to run if there already is a configuration file.
π¦ import π¦
Lets the user import .ics files with the following syntax:
khal import [-a CALENDAR] [--batch] [--random-uid|-r] ICSFILE
If an event with the same UID is already present in the (implicitly) selected calendar khal import will ask before updating (i.e. overwriting) that old event with the imported one, unless --batch is given, than it will always update. If this behaviour is not desired, use the --random-uid flag to generate a new, random UID. If no calendar is specified (and not --batch), you will be asked to choose a calendar. You can either enter the number printed behind each calendar's name or any unique prefix of a calendar's name.
π
interactive π
Invokes the interactive version of khal, can also be invoked by calling ikhal. While ikhal can be used entirely with the keyboard, some elements respond if clicked on with a mouse (mostly by being selected).
When the calendar on the left is in focus, you can:
- move through the calendar (default keybindings are the arrow keys, space and backspace, those keybindings are configurable in the config file)
- focus on the right column by pressing
taborenter - re-focus on the current date, default keybinding
tas in today - marking a date range, default keybinding
v, as in visual, think visual mode in Vim, pressingescescapes this visual mode - if in visual mode, you can select the other end of the currently marked range, default keybinding
oas in other (again as in Vim) - create a new event on the currently focused day (or date range if a range is selected), default keybinding
nas in new - search for events, default keybinding
/, a pop-up will ask for your search term
When an event list is in focus, you can:
- view an event's details with pressing
enter(ortab) and edit it with pressingenter(ortab) again (if[default] event_view_always_visibleis set toTrue, the event in focus will always be shown in detail) - toggle an event's deletion status, default keybinding
das in delete, events marked for deletion will appear with aDin front and will be deleted whenkhalexits. - duplicate the selected event, default keybinding
pas in duplicate (dwas already taken) - export the selected event, default keybinding
e
In the event editor, you can:
- jump to the next (previous) selectable element with pressing
tab(shift+tab) - quick save, default keybinding
meta+enter(metawill probably bealt) - use some common editing short cuts in most text fields (
ctrl+wdeletes word before cursor,ctrl+u(ctrl+k) deletes till the beginning (end) of the line,ctrl+a(ctrl+e) will jump to the beginning (end) of the line - in the date and time fields you can increment and decrement the number under the cursor with
ctrl+aandctrl+x(time in 15 minute steps) - in the date fields you can access a miniature calendar by pressing
enter - activate actions by pressing
enteron text enclosed by angled brackets, e.g.< Save >(sometimes this might open a pop up)
Pressing esc will cancel the current action and/or take you back to the previously shown pane (i.e. what you see when you open ikhal), if you are at the start pane, ikhal will quit on pressing esc again.
πΈ new πΈ
Allows for adding new events. khal new should understand the following syntax:
khal new [-a CALENDAR] [OPTIONS] [START [END | DELTA] [TIMEZONE] SUMMARY
[:: DESCRIPTION]]
Where start- and enddatetime are either datetimes, times, or keywords and times in the formats defined in the config file. If no calendar is given via -a, the default calendar is used. new does not support -d and also -a may only be used once.
new accepts these combinations for start and endtimes (specifying the end is always optional):
datetime [datetime|time] [timezone]time [time] [timezone]date [date]
Where the formats for datetime and time are as follows:
datetime = (longdatetimeformat|datetimeformat|keyword-date timeformat)time = timeformatdate = (longdateformat|dateformat)
And timezone, which describes the timezone the events start and end time are in, should be a valid Olson DB identifier (like Europe/Berlin or America/New_York. If no timezone is given, the defaulttimezone as configured in the configuration file is used instead.
The exact format of longdatetimeformat, datetimeformat, timeformat, longdateformat and dateformat can be configured in the configuration file. Valid keywords for dates are today, tomorrow, the English name of all seven weekdays and their three letter abbreviations (their next occurrence is used).
If no end is given, the default length of one hour or one day (for all-day events) is used. If only a start time is given the new event is assumed to be starting today. If only a time is given for the event to end on, the event ends on the same day it starts on, unless that would make the event end before it has started, then the next day is used as end date.
If a 24:00 time is configured (timeformat = %H:%M) an end time of 24:00 is accepted as the end of a given date.
If the summary contains the string ::, everything after :: is taken as the description of the new event, i.e., the "body" of the event (and :: will be removed).
Passing the option --interactive (-i <https://docs.python.org/3/using/cmdline.html#cmdoption-i>) makes all arguments optional and interactively prompts for required fields, then the event may be edited, the same way as in the edit command.
β¨ Options β¨
-l,--location=LOCATIONβ specify where this event will be held.-g,--categories=CATEGORIESβ specify which categories this event belongs to. Comma separated list of categories. Beware: some servers (e.g.SOGo) do not support multiple categories.-r,--repeat=RRULEβ specify if and how this event should be recurring. Valid values forRRULEaredaily,weekly,monthlyandyearly-u,--until=UNTILβ specify until when a recurring event should run--urlβ specify the URL element of the event--alarms DURATION,...β will add alarm times as DELTAs comma separated for this event,DURATIONshould look like1day 10minutesor1d3H10m, negative DURATIONs will set alarm after the start of the event.
πΈ Examples πΈ
These may need to be adapted for your configuration and/or locale (START and END need to match the format configured). See printformats.
khal new 18:00 Awesome Event
Adds a new event starting today at 18:00 with summary 'awesome event' (lasting for the default time of one hour) to the default calendar
khal new tomorrow 16:30 Coffee Break
Adds a new event tomorrow at 16:30
khal new 25.10. 18:00 24:00 Another Event :: with Alice and Bob
Adds a new event on 25th of October lasting from 18:00 to 24:00 with an additional description
khal new -a work 26.07. Great Event -g meeting -r weekly
Adds a new all day event on 26th of July to the calendar work in the meeting category, which recurs every week.
π edit π
An interactive command for editing and deleting events using a search string
khal edit [--show-past] event_search_string
The command will loop through all events that match the search string, prompting the user to delete, or change attributes.
π printcalendars π
Prints a list of all configured calendars.
β printformats β
Prints a fixed date (2013-12-21 21:45) in all configured date(time) formats. This is supposed to help check if those formats are configured as intended.
π search π
Search for events matching a search string and print them. Currently, search will print one line for every different event in a recurrence set, that is one line for the master event, and one line for every different overwritten event. No advanced search features are currently supported.
The command
khal search party
prints all events matching party.
βοΈ CONFIGURATION βοΈ
khal reads configuration files in the ini syntax, meaning it understands keys separated from values by a =, while section and subsection names are enclosed by single or double square brackets (like [sectionname] and [[subsectionname]]). Any line beginning with a # will be treated as a comment.
Help with initial configuration π«Ά
If you donβt have a config file yet, bestie, running khal configure will launch a small interactive tool that should help you with the initial setup of khal. Itβs giving guided-tour energy β¨
Location of configuration file π
khal looks for configuration files in these places, in this order:
$XDG_CONFIG_HOME/khal/configβ on most systems this is~/.config/khal/config~/.khal/khal.confβ deprecated- a file called
khal.confin the current directory β deprecated
Alternatively, you can specify exactly which config file to use with -c path/to/config at runtime. Very main-character of you π
The [calendars] section π
The [calendars] section is mandatory and must contain at least one subsection. Every subsection needs a unique name, enclosed by two square brackets. Each subsection needs exactly one path setting β everything else is optional. Hereβs a small example:
[calendars]
[[home]]
path = ~/.calendars/home/
color = dark green
priority = 20
[[work]]
path = ~/.calendars/work/
readonly = True
addresses = user@example.com
addresses
All email addresses associated with this account, separated by commas. For now itβs only used to check what participation status ("PARTSTAT") belongs to the user.
typeβlistdefaultβ (blank)
color
khal will use this color for coloring this calendarβs event. These color names are supported: black, white, brown, yellow, dark gray, dark green, dark blue, light gray, light green, light blue, dark magenta, dark cyan, dark red, light magenta, light cyan, light red.
Depending on your terminal emulatorβs settings, they might look different than what their name implies β no cap, terminal colors are little liars sometimes π
On top of the 16 named colors, you can use an index from the 256-color palette or a 24-bit color code, if your terminal supports it. The 256-color palette index is simply a number between 0 and 255. The 24-bit color must be given as #RRGGBB, where RR, GG, BB is the hexadecimal value of the red, green and blue component, respectively. When using a 24-bit color, make sure to enclose the color value in ' or "!
If color is set to auto (the default), khal looks for a color value in a color file in this calendarβs vdir. If the color file does not exist, the default_color (see below) is used. If color is set to '', the default_color is always used. Note that you can use vdirsyncer metasync to synchronize colors with your caldav server.
typeβcolordefaultβauto
path
The path to an existing directory where this calendar is saved as a vdir. The directory is searched for events or birthdays (see type). The path also accepts glob expansion via * or ? when type is set to discover. ** means arbitrary depths of directories. This allows for paths such as ~/accounts/*/calendars/*, where the calendars directory contains vdir directories. In addition, ~/calendars/* and ~/calendars/default are valid paths if there exists a vdir in the default directory. (The previous behavior of recursively searching directories has been replaced with globbing).
typeβstringdefaultβNone
priority
When coloring days, the color will be determined based on the calendar with the highest priority. If the priorities are equal, then the "multiple" color will be used.
typeβintegerdefaultβ10
readonly
Setting this to True will keep khal from making any changes to this calendar. Hands off, bestie π«Ά
typeβbooleandefaultβFalse
type
Setting the type of this collection (default calendar).
- If set to
calendar(the default), this collection will be used as a standard calendar β that is, only files with the.icsextension will be considered, all other files are ignored (except for a possible color file). - If set to
birthdays,khalwill expect aVCARDcollection and extract birthdays from thoseVCARDSβ that is, only files with.vcfextension will be considered, all other files will be ignored.birthdaysalso impliesreadonly=True. - If set to
discover,khalwill use globbing <https://en.wikipedia.org/wiki/Glob_(programming)> to expand this calendarβs path to (possibly) several paths and use those as individual calendars (this cannot be used with birthday collections`). See Exemplary discover usage for an example. - If an individual calendar vdir has a color file, the calendarβs color will be set to the one specified in the color file, otherwise the color from the calendars subsection will be used.
typeβ option, allowed values arecalendar,birthdaysanddiscoverdefaultβcalendar
The [default] section π
Some default values and behaviors are set here. This is where the lowkey defaults live π
default_calendar
The calendar to use if none is specified for some operation (e.g. if adding a new event). If this is not set, such operations require an explicit value.
typeβstringdefaultβNone
default_dayevent_alarm
Define the default alarm for new all dayevents, e.g. '12h'.
typeβtimedeltadefaultβ (blank)
default_dayevent_duration
Define the default duration for a day-long event ('khal new' only).
typeβtimedeltadefaultβ1d
default_event_alarm
Define the default alarm for new events, e.g. '15m'.
typeβtimedeltadefaultβ (blank)
default_event_duration
Define the default duration for an event ('khal new' only).
typeβtimedeltadefaultβ1h
enable_mouse
Whether the mouse should be enabled in interactive mode ('khal interactive' and 'ikhal' only).
typeβbooleandefaultβTrue
highlight_event_days
If true, khal will highlight days with events. Options for highlighting are in the [highlight_days] section.
typeβbooleandefaultβFalse
print_new
After adding a new event, what should be printed to standard out? The whole event in text form, the path to where the event is now saved, or nothing?
typeβ option, allowed values areevent,pathandFalsedefaultβFalse
show_all_days
By default, khal displays only dates with events in list or calendar view. Setting this to True will show all days, even when there is no event scheduled on that day.
typeβbooleandefaultβFalse
timedelta
Controls for how many days into the future we show events (for example, in khal list) by default.
typeβtimedeltadefaultβ2d
The [highlight_days] section β¨
When highlight_event_days is enabled, this section specifies how the highlighting/coloring of days is handled.
color
What color to use when highlighting β explicit color, or use calendar color when set to ''.
typeβcolordefaultβ (blank)
default_color
Default color for calendars without color β when set to '' it actually disables highlighting for events that should use the default color.
typeβcolordefaultβ (blank)
method
Highlighting method to use β foreground or background.
typeβ option, allowed values areforeground,fg,backgroundandbgdefaultβfg
multiple
How to color days with events from multiple calendars β either explicit color, or use calendarsβ colors when set to ''.
typeβcolordefaultβ (blank)
multiple_on_overflow
When multiple is set to a specific color, setting this to True will cause khal to use that color only for days with events from 3 or more calendars (hence preserving the two-color-highlight for days where all calendar colors can be displayed).
typeβbooleandefaultβFalse
The [keybindings] section π¦
Keybindings for ikhal are set here. You can bind more than one key (combination) to a command by supplying a comma-separated list of keys. For binding key combinations, concatenate the keys (with a space in between), e.g. ctrl n.
delete
Delete the currently selected event.
typeβlistdefaultβd
down
Move the cursor down (in the calendar browser).
typeβlistdefaultβdown, j
duplicate
Duplicate the currently selected event.
typeβlistdefaultβp
export
Export event as a .ics file.
typeβlistdefaultβe
external_edit
Edit the currently selected eventsβ raw .ics file with $EDITOR. Only use this if you know what you are doing β the icalendar library we use doesnβt do a lot of validation, it silently disregards most invalid data. Seriously, bestie, this one is not a casual little tap. π
typeβlistdefaultβmeta E
left
Move the cursor left (in the calendar browser).
typeβlistdefaultβleft, h, backspace
log
Show logged messages.
typeβlistdefaultβL
mark
Go into highlight (visual) mode to choose a date range.
typeβlistdefaultβv
new
Create a new event on the selected date.
typeβlistdefaultβn
other
In highlight mode, go to the other end of the highlighted date range.
typeβlistdefaultβo
quit
Quit.
typeβlistdefaultβq, Q
right
Move the cursor right (in the calendar browser).
typeβlistdefaultβright, l, space
save
Save the currently edited event and leave the event editor.
typeβlist- (the one that was just finishing up above) β default:
meta enter(yep, that's the trigger, keep it π«) searchβ pops open a text field so you can go hunt for events. type: list, default:/todayβ yeets the calendar browser's focus straight to today. type: list, default:tupβ moves the cursor up, but only inside the calendar browser. type: list, default:up,kviewβ shows the details of whatever event is selected right nowβ¦ or, if the details are already open, lets you edit it. type: list, default:enter
π¦ The [locale] section π¦
Okay bestie, listen β this one has β¨requirementsβ¨. You must set the (long)date-, time-, and datetimeformat options. Everything else in [locale] is optional and comes with sensible defaults already baked in π.
dateformatβ khal will both display and understand all dates in this format. For the format itself, go peek attimeformat.- type:
string - default:
%x
- type:
datetimeformatβ same deal but for datetimes: khal displays and understands them in this format. Format spec lives undertimeformat.- type:
string - default:
%c
- type:
default_timezoneβ this is the timezone that gets used for new events when no timezone is specified, and also when khal just cannot parse the timezone written in the icalendar file π. If you don't set a timezone at all, it falls back to whatever timezone your computer is set to.- type:
timezone - default:
None
- type:
firstweekdayβ the first day of your week, where Monday is0and Sunday is6.- type:
integer, allowed values are between0and6 - default:
0
- type:
local_timezoneβ khal shows all times in this timezone. If no timezone is set, the timezone your computer is set to is used instead.- type:
timezone - default:
None
- type:
longdateformatβ khal displays and understands all dates in this format, and it should contain a year (like%Y). Seetimeformatfor the format deets.- type:
string - default:
%x
- type:
longdatetimeformatβ khal displays and understands all datetimes in this format, and it should contain a year (like%Y). Again,timeformathas the format info.- type:
string - default:
%c
- type:
timeformatβ khal displays and understands all times in this format π .
The formatting string is interpreted exactly as defined by Python's strftime (https://docs.python.org/3/library/time.html#time.strftime), which is similar to the format specified in man strftime.
Heads up: in the config file you might need to wrap the format in quotation marks to force it to be loaded as a string π.
- type:
string - default:
%X
unicode_symbolsβ by default khal uses some unicode symbols (as in 'non-ascii') as indicators for things like repeating events. If your font, encoding, etc. doesn't support those symbols, set this toFalseand you'll get ascii-based replacements instead π«Ά.- type:
boolean - default:
True
- type:
weeknumbersβ turn on weeknumbers in calendar and interactive (ikhal) mode by saying whether they show up on the'left'or the'right'. These are iso weeknumbers, so they'll only work properly iffirstweekdayis set to0.- type:
weeknumbers - default:
off
- type:
π¨ The [palette] section π¨
This is where you override ikhal's color theme with a custom palette, so you can style individual elements of ikhal exactly how you want them. Iconic behaviour honestly.
Palette entries take the form of key = foreground, background, mono, foreground_high, background_high, where foreground and background are used in "low color mode", foreground_high and background_high are used in "high color mode", and mono is for when only monocolor is supported. If you don't want to set a value for a certain color, use an empty string (''). Valid entries for low color mode are listed on the urwid website (http://urwid.org/manual/displayattributes.html#standard-foreground-colors). For high color mode you can use any valid 24-bit color value, e.g. '#ff0000' π.
β οΈ Note: 24-bit colors must be enclosed in single quotes to be parsed correctly β otherwise the # gets interpreted as a comment. Do not skip this, bestie, or your whole vibe gets eaten π
Most modern terminals should support high color mode, no cap.
Example entry (particular ugly):
[palette]
header = light red, default, default, '#ff0000', default
edit = '', '', 'bold', '#FF00FF', '#12FF14'
footer = '', '', '', '#121233', '#656599'
See the default palettes in khal/ui/colors.py for all the available keys. And if you literally can't theme an element in ikhal, please open an issue on github (https://github.com/pimutils/khal/issues/new/choose) π.
πΎ The [sqlite] section πΎ
pathβ this is where khal stores its internal caching database. By default it lives at$XDG_CACHE_HOME/khal/khal.db(which will most likely be~/.cache/khal/khal.db).- type:
string - default:
None
- type:
π The [view] section π
The [view] section holds the config options that affect the visual appearance when you're using khal and ikhal. Main character energy, purely aesthetic β¨.
agenda_day_formatβ specifies how each day header is formatted.- type:
string - default:
{bold}{name}, {date-long}{reset}
- type:
agenda_event_formatβ the default formatting for events, used when the user asks for all events in a given time range, and used for list, calendar, and in interactive (ikhal). Please note that any color styling gets ignored in ikhal, where events are always shown in the color of the calendar they belong to. The syntax is the same as for--format.- type:
string - default:
{calendar-color}{cancelled}{start-end-time-style}{title}{repeat-symbol}{alarm-symbol}{description-separator}{description}{reset}
- type:
blank_line_before_dayβ adds a blank line before the name of the day (khal only).- type:
boolean - default:
False
- type:
bold_for_light_colorβ whether to use bold text for light colors or not. Non-bold light colors may not work on all terminals, but they do allow using light background colors.- type:
boolean - default:
True
- type:
dynamic_daysβ defines the behaviour of ikhal's right column. IfTrue, the right column shows events for as many days as fit, and moving the cursor through the list will also select the appropriate day in the calendar column on the left. IfFalse, only a fixed ([default]timedelta) amount of days' events are shown, and moving through events will not change the focus in the left column.- type:
boolean - default:
True
- type:
event_formatβ the default formatting for events used when the start- and end-date aren't clear through context, e.g. for search, and used almost everywhere except list and calendar. So it's probably a sensible choice to include the start- and end-date. The syntax is the same as for--format.- type:
string - default:
{calendar-color}{cancelled}{start}-{end} {title}{repeat-symbol}{alarm-symbol}{description-separator}{description}{reset}
- type:
event_view_always_visibleβ set totrueto always show the event view window when you're looking at the event list.- type:
boolean - default:
False
- type:
event_view_weightingβ the weighting that gets applied to the event view window.- type:
integer - default:
1
- type:
frameβ whether to show a visible frame (with box drawing characters) around some (groups of) elements or not. There are currently several different frame options available, and they should visually differentiate whether an element is in focus or not. Some of them will probably get removed in future releases of khal, so please try them out and give feedback on which style you prefer (the color of all variants can be defined in the color themes) π§.- type:
option, allowed values areFalse,width,colorandtop - default:
False
- type:
min_calendar_displayβ minimum number of months displayed by the calendar command. Default is 3 months.- type:
integer - default:
3
- type:
monthdisplayβ display the month name on the row when the week contains the first day of the month ('firstday'), or when the first day of the week is in the month ('firstfullweek').- type:
monthdisplay - default:
firstday
- type:
themeβ choose a color theme for khal.
Khal ships with two color themes, dark and light. Additionally, plugins might supply different color schemes. You can also define your own color theme in the [palette] section π.
- type:
string - default:
dark
A minimal sample configuration could look like this:
π Example
[calendars]
[[home]]
path = ~/.calendars/home/
[[work]]
path = ~/.calendars/work/
[locale]
local_timezone= Europe/Berlin
default_timezone= Europe/Berlin
timeformat= %H:%M
dateformat= %d.%m.
longdateformat= %d.%m.%Y
datetimeformat= %d.%m. %H:%M
longdatetimeformat= %d.%m.%Y %H:%M
π Exemplary discover usage
If you have the following directory layout:
~/calendars
β- work/
β- home/
ββ family/
where work, home and family are all different vdirs, each containing one calendar, then a matching calendar section could look like this:
[[calendars]]
path = ~/calendars/*
type = discover
color = dark green
π Syncing
To get khal working with CalDAV you'll first need to set up vdirsyncer (https://github.com/pimutils/vdirsyncer). After each start, khal will automatically check if anything has changed and automatically update its caching db β and yes, this may take some time after the initial sync, especially for large calendar collections π. Because of that, you might want to execute khal automatically after syncing with vdirsyncer (e.g. via cron).
π¦ RDATE;VALUE=PERIOD π¦
Okay so RDATEs that come with PERIOD values? Not supported rn, bestie π and it's not even khal's fault β it's because icalendar (https://github.com/collective/icalendar) doesn't support it yet. So if you have any real-world examples of events with RDATE;VALUE=PERIOD lying around, please submit them! khal will literally print warnings at you if you've got any of those hanging out in your calendars, so you'll know. π
π« RANGE=THISANDPRIOR π«
Recurrent events with RANGE=THISANDPRIOR are not supported by khal, and will not be [1] supported, because apps that follow the latest standard (http://tools.ietf.org/html/rfc5546) MUST NOT create those in the first place. If khal bumps into an event containing RANGE=THISANDPRIOR, it'll print a warning at you. β οΈ
[1] unless a lot of users request this feature β like, a LOT lot. π«Ά
πΈ Events with neither END nor DURATION πΈ
So the RFC is out here saying:
A calendar entry with a "DTSTART" property but no "DTEND" property does not take up any time. It is intended to represent an event that is associated with a given calendar date and time of day, such as an anniversary. Since the event does not take up any time, it MUST NOT be used to record busy time no matter what the value for the "TRANSP" property.
β¦and khal is like "cute, anyway" and transforms those events into all-day events lasting for one day (the start date). As long as those events don't get edited, these changes will not be written to the vdir (and with that, not to the CalDAV server). Any timezone information that was associated with the start date gets discarded. ποΈ
Note: the main rationale for this behaviour was laziness on the part of khal's main author π but honestly other calendar software does the exact same thing (e.g. Google Calendar and Evolution), so it's giving "we all agreed to be like this." π
π Timezones π
Getting localized time right seems to be the most difficult part about calendaring (and messing it up ends in missing the one important meeting of the week β the horror π). So I'll briefly describe here how khal tries to handle timezone information, which information it can handle, and which it can't.
In general there are two different types of events:
- Localized events β with localized start and end datetimes, which have timezone information attached to their start and end datetimes.
- Floating events β with floating start and end datetimes, which have no timezone information attached (all-day events, and events that last for complete days, are floating as well).
Localized events are always observed at the same UTC (https://en.wikipedia.org/wiki/Coordinated_Universal_Time) β no matter what time zone the observer is in β but at different local times. On the other hand, floating events are always observed at the same local time, which might be different in UTC. Make it make sense, I know. π
In khal, all localized datetimes are saved to the local database as UTC. Datetimes that are already UTC, e.g. 19980119T070000Z, are saved as such, and others are converted to UTC (but don't worry, the timezone information does not get lost π). Floating events get saved in floating time, independently of the localized events.
If you want to look up which events take place at a specified datetime, khal always expects that you want to know what events take place at that local datetime. So the (local) datetime you asked for gets converted to UTC, the appropriate localized events get selected, and they're presented with their start and end datetimes converted to your local datetime. For floating events, no conversion is necessary. β¨
Khal (i.e. icalendar β https://github.com/collective/icalendar) can understand all timezone identifiers as used in the Olson DB (https://en.wikipedia.org/wiki/Tz_database) and custom timezone definitions β if those VTIMEZONE components are placed before the VEVENTS that make use of them (as most calendar programs seem to do). In case an unknown (or unsupported) timezone is found, khal will assume you want that event to be placed in the default timezone (which can be configured in the configuration file as well π).
khal expects you always want all start and end datetimes displayed in local time (which can be set in the configuration file as well β otherwise your computer's timezone is used). π°οΈ
π FAQ π
Frequently asked questions, bestie:
- Installation stops with an error:
source/str_util.c:25:20: fatal error: Python.h: No such file or directory- You do not have the Python development headers installed. On Debian based Distributions you can install them via
aptitude install python-dev. Slay, fixed. π
- You do not have the Python development headers installed. On Debian based Distributions you can install them via
unknown key "default_command"- This key was deprecated by
f8d9135. Seehttps://github.com/pimutils/khal/issues/648for the rationale behind this removal. rip to a real one ποΈ
- This key was deprecated by
π LICENSE π
khal is released under the Expat/MIT License:
Copyright (c) 2013-2022 khal contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
π Author π
Christan Geier et al. β icons, the lot of them. π
π Copyright π
Copyright (c) 2013-2022 khal contributors
Okay that's the whole page, you made it to the end!! π This beauty is khal 0.14.1, dated Aug 21, 2026 β go forth and never miss a meeting again, fr fr. π
β¨π«Ά
π¦ where this page comes from
- arch rolling: khal 0.14.1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms