Star on GitHub
tauler

tauler

Declare panels, wallpapers and Units for a Linux desktop in one layout file.

Tauler draws status bars and panels on Linux from one file, ~/.config/tauler/layout.op.mdx. Its render function returns a <root> element holding <panel> and <wallpaper> nodes; Tauler evaluates it on every data tick and renders each panel into an X11 window or a Wayland layer surface.

The rendering model

Tauler borrows JSX syntax, but the execution model is deliberately simpler than React's. Rather than tracking state and re-rendering the subtrees that changed, Tauler is a pure function called on every tick:

code
(all stream values) → UI tree

There is no component state, no effects, no virtual DOM diffing and no lifecycle. The whole render function runs top to bottom on each tick and produces a fresh layout tree — closer to a spreadsheet than to React.

Streams replace useState and useEffect

Where React subscribes to external data with useEffect and useState, Tauler declares the data source inline and hands you the latest value synchronously:

jsx
const time = useStringStream("/usr/bin/bash", "while true; do date; sleep 1; done");

The runtime owns the subprocess lifecycle, so there is no subscription or cleanup code to write.

Joining streams is just closures

Every stream value is computed at the top of the render function, which puts it in scope everywhere below. Sharing data between unrelated parts of the tree needs no context provider and no prop drilling:

jsx
const notifications = useJSONStream("...tauler-notify")?.notifications ?? [];

const [i3, dispatch] = useService("...tauler-i3");

// notifications and i3 are both in scope here
const urgent = notifications.some(n => i3?.workspaces.find(...));
return <WorkspaceList urgent={urgent} />;

History comes from a pipe

Tauler keeps one value per stream, the latest line, so nothing in the render function can look backwards. History is added by piping the source through tauler-accumulate, which hands you a window instead of a value:

jsx
const load = useJSONStream("/bin/sh", `
  while :; do cut -d' ' -f1 /proc/loadavg; sleep 1; done | tauler-accumulate -n 60
`) ?? [];

load is the last 60 samples, oldest first. A naive shell loop gets history without becoming stateful — see Read a value from an external program.

Where this model stops

A pure function cannot express state that persists across ticks — "this workspace has had a notification since you last looked at it", for example. A window of recent values will not do it either, because the interesting part is what you have already seen. That kind of memory lives outside the render function: in a store the layout declares, or in a service, a program that holds the state. Handling dynamic data says how to choose.

Screen layout

Panels are placed on a screen, and the space they occupy has to be reserved from the window manager explicitly — anchor alone does not do it. The layout page covers <I3Layout>, which derives the reservation from the panels themselves.

Components

Tauler ships a set of built-in UI components. The components page explains the three kinds — Data, Display and Control — and what tells them apart. The component reference lists every shipped one; each entry is generated from the component's own doc comments, and each screenshot is produced by really rendering the example.