aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: a5662fc0ebad71c3b3c8be2a4783fb75d73447ae (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# colitur-x

A raw Xlib front-end for [colitur](../colitur): reads `colitur emit --format
csv` on stdin, draws the year as a month grid coloured by each day's
liturgical colour, and shows the selected day's readings underneath.

    colitur emit --format csv --from 2027 --to 2027 | colitur-x

Keys: arrows or `hjkl` move, `n`/`p` change month, `q` quits.

## Why it exists

colitur is a Unix tool: it computes and prints. This is a separate program
that composes with it, so colitur's own dependencies stay frozen
(`dune alcotest qcheck qcheck-alcotest sexplib ppx_sexp_conv`) and its
kernel stays pure.

## Build

    make

`-std=c99 -Os -Wall -Wextra`, linking libX11 and libXft. ~17 KB.

Configuration is compile-time, suckless style: edit `config.h` and rebuild.
There is deliberately no runtime config file — colitur itself owns the
calendar's configuration (language, sigla, overlays); this program owns only
how it is painted.

## Limits, stated rather than discovered

- X11 only. Runs under XWayland but is not a Wayland client.
- Read-only. It renders what colitur emits; it edits nothing.
- Xft is used for antialiasing and UTF-8. Dropping it for core X11 fonts
  would reduce the dependency list to libX11 and libc alone, at the cost of
  correct rendering for `æ`/`œ` and Polish diacritics. Not worth it.
- A tiling window manager will ignore the size hints and give the grid its
  own tile; the layout handles that, the empty space is the WM's choice.

## colitur-mu — the microui variant

`colitur-mu` is the same idea with an *editable* surface: year, language,
book-name form and numbering tradition are buttons, and changing any of them
re-runs colitur and reloads. It reimplements no calendar logic — every value
on screen came out of `colitur emit --format csv`, and the exact command is
shown in the status line.

    make colitur-mu && ./colitur-mu

microui (MIT, rxi) is **vendored** in `vendor/`, 1504 lines. That is the point:
a copied-in dependency cannot rot. `mu_x11.c` is the Xlib/Xft backend, ~150
lines — microui emits a command list and asks two font-metric questions; this
answers them.

### One bug worth recording

microui resets its scissor by emitting an "unclipped" rectangle of
`0x1000000` × `0x1000000`. `XRectangle`'s width and height are **unsigned
short**, so that truncates to **0** — turning "clip nothing" into "clip
everything". The symptom is that a scrolling panel draws its first screenful
and everything after it silently disappears, which looks like a layout or
buffer-overflow bug and is neither. `set_clip()` clamps to the buffer bounds
before converting.

### Which to use

`colitur-x` renders; `colitur-mu` renders and lets you change the invocation.
Neither is the right answer for a non-technical user on a machine that is not
yours — both are X11-only and must be compiled. For that, a static site or a
small local web UI wins.