Skip to content

About

Polybar module that shows the next calendar event with color-coded urgency and a click-to-open detail dialog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

polybar-next-event

A polybar module that fetches your calendar and displays the next upcoming event directly in the bar. Events are color-coded by urgency so you never miss a meeting.

Features

  • Next event display — shows the title and time of your next calendar event in the polybar
  • Color-coded urgency:
    • > 1 hour away — green (#A3BE8C)
    • 15–60 min away — yellow (#EBCB8B)
    • < 15 min away — red (#BF616A)
  • Click-to-open dialog — clicking the event opens a styled dialog window with event details (title, time, location, description, attendees) and a list of upcoming events

Tech Stack

  • Runtime: Bun
  • Language: TypeScript (strict mode)
  • Calendar: CalDAV via tsdav
  • UI dialog: webview-bun (native HTML/CSS rendering via GTK4 + WebKitGTK)
  • Bar integration: Polybar custom/script module

Prerequisites

  • Polybar installed and configured
  • Bun runtime
  • A CalDAV-compatible calendar (Fastmail, Nextcloud, etc.)

Installation

Quick setup

git clone https://github.com/traedamatic/polybar-next-event.git
cd polybar-next-event
./install.sh

The install script will build the project, create a .env file from the example, and print the polybar config to add.

Manual setup

git clone https://github.com/traedamatic/polybar-next-event.git
cd polybar-next-event
bun install
bun run build
cp .env.example .env

Edit .env with your calendar credentials, then add the module to your polybar config:

[module/next-event]
type = custom/script
exec = bun /path/to/polybar-next-event/dist/polybar/output.js
click-left = bun /path/to/polybar-next-event/src/dialog/show-dialog.ts
interval = 60
label = %output%

Then add next-event to your bar's modules-right (or modules-left/modules-center).

Configuration

Create a .env file with your calendar credentials (see .env.example):

CALENDAR_URL=https://caldav.fastmail.com/dav/principals/user/you@fastmail.com/
CALENDAR_USERNAME=you@fastmail.com
CALENDAR_PASSWORD=your-app-password-here

Multiple calendars

To show events from several accounts (e.g. a private and a business Fastmail account), use numbered variables instead. Events from all accounts are merged and sorted into a single list; if one account fails (e.g. a wrong password) the others still show.

CALENDAR_1_URL=https://caldav.fastmail.com/dav/principals/user/private@fastmail.com/
CALENDAR_1_USERNAME=private@fastmail.com
CALENDAR_1_PASSWORD=private-app-password
CALENDAR_1_FILTER=Persönlich          # optional, per account

CALENDAR_2_URL=https://caldav.fastmail.com/dav/principals/user/work@fastmail.com/
CALENDAR_2_USERNAME=work@fastmail.com
CALENDAR_2_PASSWORD=work-app-password
CALENDAR_2_FILTER=Work,Team Cal

The unnumbered CALENDAR_* variables still work for a single account, and if set are added as one more account alongside any numbered ones.

Optional settings:

POLL_INTERVAL=60         # polling interval in seconds (default: 60)
COLOR_FAR=#A3BE8C        # > 1 hour away (default: green)
COLOR_MEDIUM=#EBCB8B     # 15-60 min away (default: yellow)
COLOR_URGENT=#BF616A     # < 15 min away (default: red)
CALENDAR_FILTER=...      # comma-separated calendar names (single-account form)

Development

bun run dev        # start with hot reload
bun test           # run tests
bun run build      # build for production

Links

About

Polybar module that shows the next calendar event with color-coded urgency and a click-to-open detail dialog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages