| Age | Commit message (Collapse) | Author | Files | Lines |
|
Add card.ICON and a card.title helper that draws the glyph in the
highlight colour before the label, at the label's own size. The eight
labelled cards use it, in both the fit_unit width measurement and the
draw, so the icon cannot overrun a narrow cell. Clock (no label) and
weather (condition glyph already) are unchanged, and the no-data notice
titles stay text-only.
Codepoints were chosen against a rendered contact sheet, not fontconfig
alone, since a wrong codepoint draws a plausible neighbour.
|
|
Extract card.notice so every cached card's no-data state is one fluid,
theme-consistent face instead of a copy per widget, and delete the
fixed-size card.label it replaces.
Derive weather's arc geometry from its band (pad, curve room, sun dot,
time labels) instead of fixed pixels, and cap the arc at a proportion of
the card's width rather than 240px.
Derive disks' bar-fallback height and its address type from the card's
own label scale.
Standardise the big-value factor to 1.0 across the fit_unit cards and
document the big-value colour rule and the disks headline exception.
|
|
Replaces the Waybar module that used to show breaktimer.sh with a card
on the dashboard. The card's big value is the phase countdown, coloured
by phase with the same language the Waybar module used, and two rows
name the phase and what the countdown leads to.
Data comes from bin/breaktimer-sample.sh, run by conky at execi 5, which
reads the daemon's runtime files into a cache. The sampler owns the
kill -0 liveness check, because conky's Lua cannot run a process and a
dead daemon must read as 'fermo' rather than a stale 'running'.
Drops outside the work-hours window freeze the countdown while the phase
stays 'working'. The sampler detects this from the remain file's age and
the card reads it as 'outside working hours', which also covers a hung
daemon. The phase words and colour roles live in data.breaktimer_parse
so they are unit-tested; the card only draws the result.
|
|
The month grid with the week's appointments below it, colour-coded by
calendar. Events come from a cache file rather than a live call: khal
costs about 200ms of Python startup, which is two orders of magnitude
over the 2-second draw budget, so bin/calendar-sample.sh writes the
cache on a 5-minute execi and the widget only parses.
Calendar colours are read out of khal's own config by the sampler and
mapped onto the board's palette roles, so the card follows a scheme
change instead of pinning three literal hues.
khal will not emit an ISO date: {start-date} uses the user's dateformat,
which carries no year here, and a strftime spec inside the field raises.
The sampler asks for {start-date-long} and data.calendar_date recovers
the numbers by position, resolving day/month by magnitude and reading a
genuinely ambiguous pair day-first. A 2-digit year is refused rather
than guessed at.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Two lines on one chart against a shared ceiling, one sample per pixel column
so nothing is interpolated. The history is module state sized from the card's
width, so moving the card reframes the window rather than clearing it.
The public address is refused once stale: an address that may no longer be
yours, displayed with confidence, is worse than a dash.
The fixture uses TEST-NET-1. This repository is public.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Free space is read rather than derived: size - used overstates it by the
root-reserved blocks, tens of gigabytes on a large filesystem, none of it
available to anyone but root.
Also asserts fs[3], the row whose device name ends in a digit. It sits next
to a numeric column and is the row most likely to break a parser counting
fields, and nothing covered it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
The pattern required a literal CPU token immediately before the @, which the
one Intel fixture happens to carry. A Xeon reads 'E5-2680 v4 @ 2.40GHz' and a
Tiger Lake 'i7-1165G7 @ 2.80GHz', so both kept their clock on the card.
A generation prefix hid the vendor word from its anchor for the same reason:
'11th Gen Intel Core i7-1165G7' kept 'Intel'.
Three more forms added as tests. The Intel fixture was meant to keep the
stripping a rule, and one fixture was not enough to do it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Stripping by rule rather than by a table of known parts: a leading vendor
word, trademark noise, a trailing core count or clock. The Intel fixture
exists to keep it a rule.
DMI placeholders read as no board at all. 'To Be Filled By O.E.M.' on the
dashboard is worse than a blank row.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Only the first space separates, so a value keeps its own spaces. Values stay
strings: the sampler writes epochs and the widget decides whether an age
reads as hours or days.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
Mirrors new_cpu_counter: cumulative counters need two samples to yield a
rate, and each direction carries its own previous reading.
Clamps a negative delta to zero rather than letting a 32-bit wrap or an
interface reset produce a spike. One bogus sample sets the shared autoscale
and flattens the entire window.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
Several series on one baseline and one ceiling. The shared ceiling is the
point: scaled independently, a 200kB/s upload draws the same height as a
40MB/s download, which is a lie about a link's shape.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
A ring left its line width behind, so the next stroke on the card inherited
a hairline several pixels thick. It already restored the cap for the same
reason.
card.truncate replaces byte slicing, which cuts a multi-byte character in
half and emits an invalid sequence Cairo draws as a box.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
The big value moves to the right of the heading, on the same baseline,
so the card's width carries it instead of leaving the right half empty.
Type now scales to fill the cell: card.fit_unit measures the rows and
returns the largest size that fits the width, and the widget takes the
smaller of that and its height budget, shrinking only where a row would
collide.
|
|
Memoize hwmon_dir by chip name so sensor reads no longer popen grep on
every frame, cache misses included. Floor fractional byte counts in
card.human so it cannot raise. Drop the GPU package-temperature row,
which duplicated the headline. Set umask before mkdir in both samplers
so a fresh cache directory is not world-readable. Make render.lua exit
non-zero on a draw error and tolerate an unset HOME.
|
|
disks draws a ring per filesystem from the df sample, with the NFS
server address read from the device field and a labelled-bar fallback
when the rings would be too small to read. cache shows the ~/.cache
total and its four largest children from the du sample.
card.ring now resets the cairo path first: a preceding card.text()
leaves a current point, and cairo_arc() joins to it with a straight
line, so the disks rings were drawn with stray chords. The ring
primitive had no caller until now, which is why it went unnoticed.
|
|
|
|
|
|
|
|
Installs Oswald (OFL-1.1, from googlefonts/OswaldFont) under
~/.fonts/o/Oswald with its license, and points the clock numerals at it
for the squared look the rounded Noto Sans Black did not have.
Per-widget fonts needed no new machinery: card.font() already takes any
family string, so FONT_* are shared defaults rather than a restriction.
FONT_CLOCK joins them, and the weather card keeps FONT_HEAVY, so the two
no longer have to agree.
Cairo still cannot ask for a weight above bold, so a heavier cut is
selected by family name as FONT_HEAVY already did. Worth knowing that
fontconfig substitutes a default for a family it does not recognise,
which is indistinguishable from the font not applying; fc-match tells
you which happened.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
is_stale and age_str were the only functions in the module doing
arithmetic on an unchecked argument: a nil `now` raised, and a raise in
this project is a blank dashboard with no message. Every caller passes
os.time(), which cannot be nil, so this was unreachable, but it is the
same bug already fixed once in icon() and the module header promises
nothing raises.
age_str also printed a negative age when the observation timestamp was
in the future, which a clock skew can produce. "stale -17m" on the card
reads as a broken widget, so the age now floors at zero and such a
reading counts as fresh: weather from the future is not old.
With this the whole module is raise-free, verified across every function
against nil, string, table, boolean, NaN, negative and zero arguments in
all three positions.
Both cases were found by the Task 5 implementer, which was asked to
probe beyond its given tests and reported them without changing the code.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
The numeric patterns stopped at the 'e', so a temp of 1.8e1 parsed as
1.8 and the card would have drawn 2 degrees instead of 18. Wrong in the
worst way available: silently, and still looking like weather.
OWM has not been seen to emit exponent form, and sampling several cities
near and below zero returned plain decimals throughout, so this was not
reachable in practice. Fixed regardless, because two characters in a
character class is cheaper than the reasoning required to be sure it
stays unreachable, and unlike the NaN case noted in sun_t this one fails
invisibly rather than leaving a mark.
Tests now cover both a negative temperature, which is ordinary here for
half the year, and the exponent form. Reverting the pattern fails them.
Found by adversarial probing of the committed parser, not by the plan's
own tests, which only exercise the fixture.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Lua patterns instead of a JSON library: the current-weather response
is flat and known, so six scalars do not justify a dependency. Every
failure path (truncated write, empty file, garbage, an API error body,
nil input) returns nil rather than raising, since a Lua error here is
a blank dashboard.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
NaN is a number, so the type guard admits it, and every comparison
against NaN is false, so neither clamp catches it and the function
returns NaN.
Left unguarded on purpose. No caller can produce it: parse() matches
%d+ for the sun times and `now` is os.time(). If one ever did, Cairo
ignores a NaN coordinate, so the arc would lose its dot rather than the
dashboard going blank. A ponytail: comment names the ceiling and where
the guard would go.
Found while probing the committed code, not by the tests, which do not
cover NaN.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Two comments, no behaviour change.
`force - 1` reads as an off-by-one until you know the scale starts at 0
while ipairs starts at 1, so the loop index is already force + 1. Said
plainly now, along with why the fall-through returns 12.
compass() has no caller: the card draws arrow(). It is kept because it
shares arrow()'s binning exactly, so testing both pins that shared logic
from two angles, and switching the card to "S 9 km/h" becomes a one-word
change. Without this note the next reader finds an unused function and
has to reconstruct the reasoning.
Raised by code review as the only two points worth acting on; no
Critical or Important issues were found.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
icon(800, nil, 1500, 1900) compared nil against a number and raised,
which in this project is a blank dashboard with no message. The module's
own header promises nothing raises, and is_day() already guards the same
case, so the inconsistency was the bug.
Not reachable from the widget as written: it passes os.time(), and
parse() refuses a response without sunrise and sunset, so no caller can
currently produce the failing combination. Fixed anyway, because the
contract is what future callers will rely on and the fix is one word.
The test file also now says why the codepoint VALUES carry no assertion:
comparing M.ICON.snow against a literal would only prove the escape was
typed twice. Whether E31A draws a snow cloud is what the glyph sheet is
for, and mutation testing confirms the assertions cannot see it.
Found by code review. The same fix is applied to the plan, so Tasks 2-5
inherit the guarded version.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
The date rendered as "16 /SEP /2026", each slash jammed against the
next glyph. measure() returns the ink width, which ignores leading and
trailing spaces because a space carries no ink, and clock.lua was using
it to advance a cursor. Measured: " / " covers 6px of ink but advances
14px, so every separator lost 8px.
Splits the two uses that were conflated in one function. measure() is
for centring and right-aligning, where ink width is what you want;
advance() returns x_advance and is for laying out runs of text left to
right. The clock's date now uses advance() and reads "16 / SEP / 2026"
with even gaps, verified by screenshot.
Worth the split rather than changing measure() in place: text_right is
a correct caller of the ink width, so one function cannot serve both
and silently returning the advance would have broken alignment
instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Two defects, both found by review of the Cairo work and both confirmed
by experiment rather than reasoning.
The palette mechanism could not have worked. conky_parse('${color3}')
returns an empty string: conky's colour variables emit renderer escape
codes into conky.text, they never evaluate to a hex string, and
${default_shade_color} is not a variable at all, so conky_parse hands
the literal text back. conky.config is not exposed to Lua either
(_G.conky is nil) and conky_info carries only cpu_count and
update_interval. What Lua does get is conky_config, the config file's
path, so the colours are now parsed out of that file, where UDT has
already substituted real hex. The pattern needs [%w_]+ rather than %w+
or it misses default_color and default_shade_color.
The card fill also duplicated the border colour, both being color3, so
filling at 0.55 alpha and stroking the hairline at 0.9 in one hue made
the border invisible and the cards read as blobs rather than the
mockup's thin outlines. The fill is default_shade_color now, a role
every scheme already defines.
card.measure allocated a cairo_text_extents_t per call, which leaks:
5000 allocations grow Lua's heap by 182KB that GC never reclaims, and
:destroy() on each does not help, measured at the same 182KB. One
reused module-level struct costs 0KB. A draw hook running every 2s
would have bled memory for as long as conky stayed up, which no
screenshot would ever reveal.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Rounded-rect card with a hairline border, text helpers with measured
alignment, and font selection.
Cairo's font API stops at BOLD, so the Black face is reached by family
name instead of weight: at size 90, '13' measures 100px as Noto Sans
Black against 94px as Bold, confirming the heavier face is selected.
The card radius is clamped to half the shorter side, because a larger
radius makes the corner arcs overlap into a bowtie.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Load is a delta, so one reading cannot yield a percentage. The first
call returns nil rather than a fabricated number: 100% on startup reads
as a real spike.
A non-advancing counter also returns nil instead of dividing by zero,
and the result is clamped because a suspend/resume can produce a
nonsense delta.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
Parsers take file contents as a string, not a path, so they test
against committed fixtures with no filesystem mocking.
hwmon is globbed by its name file rather than a fixed index, carried
over from the old config: indices drift across kernel reorders and a
stale one silently reads a different chip.
Failure returns nil, never 0. A sensor reading 0 C is legitimate, so 0
cannot double as an error value.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|