A calendar item reads events from the calendars available through Apple EventKit. It shows an ongoing timed event first, then an ongoing all-day event, then the next event by start time. Cancelled and ended events are excluded. The Calendar example includes a complete bar configuration.

{
  "id": "next-event",
  "type": "calendar",
  "calendar": {
    "lookaheadDays": 7,
    "includeAllDay": false,
    "hideWhenEmpty": true
  }
}

The default label is the local start time and title, Now and title for an ongoing timed event, or All day and title for an all-day event. Blank titles display Untitled event.

Configuration #

Set these options inside calendar:

PropertyDefaultDescription
lookaheadDays7Event horizon, from 1 to 30 days.
includeAllDaytrueInclude all-day events in selection.
timeFormatSystem short timeNonblank DateFormatter pattern for start and end times.
showSymboltrueShow the provider symbol or item-level override.
hideWhenEmptyfalseHide only confirmed empty results. Permission and read failures stay visible.
symbolsStatus symbolsOverrides for loading, upcoming, ongoing, empty, unauthorized, and unavailable.
tintsNormal item tintColours keyed by the same six status names.

Symbols accept SF Symbol names or font glyph objects, with shared font and size inside symbols. The default symbol is calendar, calendar.badge.clock for an ongoing event, or calendar.badge.exclamationmark for denied access and read failures. A top-level symbol overrides the status symbol.

Permission and updates #

The first enabled Calendar item requests full Calendar access. macOS requires this permission to read events even though sbar never edits them. Calendar and Reminders permissions are separate. Validation does not request access.

EventKit runs inside the standalone executable. macOS may attribute permission to the launching terminal. Check System Settings > Privacy & Security > Calendars for the application macOS names. Permission behaviour needs verification from the intended launcher.

The provider reads on activation, after EventKit change notifications, and every minute. Enabled Calendar items share one query using the longest configured lookahead; each item selects its event independently. Removing the last active item stops monitoring. Item refresh policies control displayed snapshots independently of those reads. Manual snapshots hold event fields and minutesUntil until triggered.

The labels are Loading calendar before a result, No events for an empty selection, Calendar permission denied for denied access, and Calendar unavailable for failures. Event data stays in memory and is not sent to a server.

Text templates #

Use top-level text to customise the label:

{
  "id": "next-event",
  "type": "calendar",
  "text": "{{#status=upcoming}}{{startTime}} ยท {{title}}{{/status}}{{^status=upcoming}}{{value}}{{/status}}",
  "calendar": {
    "timeFormat": "HH:mm",
    "tints": { "ongoing": "#66CC88", "unauthorized": "#FF6655" }
  }
}
FieldMeaning
valueDefault label, including empty and error labels.
statusloading, upcoming, ongoing, empty, unauthorized, or unavailable.
availableTrue for upcoming, ongoing, and empty results.
title, calendarSelected event title and calendar name.
startTime, endTimeLocal times using timeFormat, or the system short format.
minutesUntilMinutes until the event starts, rounded up; zero for ongoing events.
allDayWhether the selected event is all-day.

Without a selected event, event strings are empty and allDay is false. Shared id and symbol fields also apply. There is no event collection loop.

Set top-level text: "" for an icon alone. The accessibility label still includes the default event title, so hiding the text does not conceal that title from accessibility output.

Search docs

Enter a word or command.