diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-30 17:34:26 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-30 17:34:26 +0100 |
| commit | 4506646c66c5c5d05278fe2ada76b482e142f09e (patch) | |
| tree | 14b1908a9f5e1ad0a5a53862a869a3d7f67283b6 /lib | |
| parent | 6b08e092b9e1e0774c2ad81dcf414c9095d87cf9 (diff) | |
| download | conky-theme-udt-4506646c66c5c5d05278fe2ada76b482e142f09e.tar.gz conky-theme-udt-4506646c66c5c5d05278fe2ada76b482e142f09e.zip | |
breaktimer is parked and no longer runs, so the card only ever showed
"no breaktimer data". Drop the widget, its sampler and the texeci that
ran it every 5s, the parser and its tests, the icon, and the doc examples
that used it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/card.lua | 2 | ||||
| -rw-r--r-- | lib/data.lua | 74 |
2 files changed, 0 insertions, 76 deletions
diff --git a/lib/card.lua b/lib/card.lua index 3dd4b12..221d8d2 100644 --- a/lib/card.lua +++ b/lib/card.lua @@ -224,7 +224,6 @@ end -- fontconfig alone: a missing glyph draws as an invisible blank and a wrong -- codepoint as a plausible neighbour, so neither fails visibly. M.ICON = { - breaktimer = '\u{F13AB}', -- timer calendar = '\u{F0E17}', -- calendar-month immich = '\u{F02F9}', -- image-multiple hourly = '\u{F0150}', -- clock-outline @@ -331,7 +330,6 @@ end -- -- Returns the y where the drawn content ends and S, so a card can put its -- variable band in what is left and size the band's type off the same S. --- The proportions are the breaktimer card's, which this generalises. function M.standard(cr, inner, colors, spec) local LABEL_F, BIG_F, ROW_F = 0.30, 1.0, 0.32 local rows = spec.rows or {} diff --git a/lib/data.lua b/lib/data.lua index 818bbf1..dca039a 100644 --- a/lib/data.lua +++ b/lib/data.lua @@ -162,80 +162,6 @@ function M.month_shape(year, month) return last.day, (first.wday + 5) % 7 + 1 end --- The breaktimer cache written by bin/breaktimer-sample.sh. --- --- Returns a table describing the daemon, or nil when the cache is absent or --- carries no 'generated' key (the sampler never ran). The display strings are --- derived here rather than in the widget so the phase-to-word and --- phase-to-colour decisions can be tested without Cairo: --- --- { running, state, phase, frozen, remain, --- countdown = '24:31' or '--', --- phase_label = 'working' | 'micro-pausa' | 'pausa lunga' | 'in pausa' --- | 'outside working hours' | 'fermo', --- next = 'pausa' | 'lavoro' | '--', --- role = 'ok' | 'heading' | 'highlight' | 'warning' | 'label' } --- --- `frozen` is the sampler's read of whether the clock is ticking: the phase is --- 'working' but the remain file has stopped being rewritten. Outside the work --- window that is normal and reads as such; a hung daemon looks the same, and --- should. --- --- The countdown leads to the next phase, but the daemon keeps the cycle count --- in memory and never writes it, so whether the NEXT break is a micro or a long --- one is not knowable here. 'pausa' is the honest answer; the phase word carries --- the rest. -function M.breaktimer_parse(text) - if type(text) ~= 'string' then return nil end - local kv = M.kv_parse(text) - if not kv.generated then return nil end - - local running = kv.running == 'yes' - local state = kv.state or 'stopped' - local phase = kv.phase or 'stopped' - local remain = tonumber(kv.remain) or 0 - if remain < 0 then remain = 0 end - - local out = { - running = running, - state = state, - phase = phase, - frozen = kv.frozen == 'yes', - remain = remain, - } - - -- Not running and stopped are the same thing on the card. The sampler's - -- liveness check is what turns a dead PID into this reading: the state file - -- can still say 'running' after a crash or a kill -9. - if not running or state == 'stopped' then - out.countdown = '--' - out.phase_label = 'fermo' - out.next = '--' - out.role = 'label' - return out - end - - out.countdown = string.format('%d:%02d', math.floor(remain / 60), remain % 60) - - if state == 'paused' then - out.phase_label = 'in pausa' - out.role = 'warning' - elseif out.frozen then - out.phase_label = 'outside working hours' - out.role = 'label' - else - local labels = { working = 'working', breaking = 'micro-pausa', - longbreak = 'pausa lunga' } - local roles = { working = 'ok', breaking = 'heading', - longbreak = 'highlight' } - out.phase_label = labels[phase] or phase - out.role = roles[phase] or 'value' - end - - out.next = (phase == 'working') and 'pausa' or 'lavoro' - return out -end - -- The Immich memories index written by bin/immich-fetch.sh. -- -- Returns a list of { id, year, taken = { y, m, d, H, M }, place }, plus |
