aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/slackware.lua
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-18 18:41:31 +0200
committerDanilo M. <danix@danix.xyz>2026-09-18 18:41:31 +0200
commit7fddddcd39bb250cd2653e130c8f7899d2d3f19c (patch)
treeca427df07676563853fb7f25f6ce4eb14e63a25b /widgets/slackware.lua
parent37cabe2fea2f86d481516aae6ddaeb14bac2e64f (diff)
downloadconky-theme-udt-7fddddcd39bb250cd2653e130c8f7899d2d3f19c.tar.gz
conky-theme-udt-7fddddcd39bb250cd2653e130c8f7899d2d3f19c.zip
refactor: unify card no-data face and fluid sizing
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.
Diffstat (limited to 'widgets/slackware.lua')
-rw-r--r--widgets/slackware.lua16
1 files changed, 2 insertions, 14 deletions
diff --git a/widgets/slackware.lua b/widgets/slackware.lua
index 709438d..f9afb70 100644
--- a/widgets/slackware.lua
+++ b/widgets/slackware.lua
@@ -33,26 +33,14 @@ end
function M.draw(cr, rect, colors)
local inner = card.card(cr, rect, colors)
local function clamp(v, lo, hi) return math.max(lo, math.min(hi, v)) end
- local LABEL_F, BIG_F, ROW_F = 0.30, 0.85, 0.32
+ local LABEL_F, BIG_F, ROW_F = 0.30, 1.0, 0.32
local kv = data.kv_parse(data.slurp(CACHE) or '')
-- No cache at all: the sampler has not run. Name it, as the cache card does,
-- rather than leaving a blank cell that is indistinguishable from a crash.
if not kv.version then
- local S = clamp(inner.h * 0.94 / (1.78 + 2 * 0.72), 10, 72)
- S = math.min(S, card.fit_unit(cr, inner.w * 0.96, {
- { { 'SLACKWARE', card.FONT_MONO, LABEL_F } },
- { { 'no slackware data', card.FONT_UI, 0.36 } },
- { { 'bin/slackware-sample.sh', card.FONT_MONO, ROW_F } },
- }, 100))
- card.font(cr, card.FONT_MONO, S * LABEL_F, false)
- card.rgba(cr, colors.label)
- card.text(cr, inner.x, inner.y + S * LABEL_F, 'SLACKWARE')
- card.font(cr, card.FONT_UI, S * 0.36, true)
- card.text(cr, inner.x, inner.y + S + S * LABEL_F * 2.6, 'no slackware data')
- card.font(cr, card.FONT_MONO, S * ROW_F, false)
- card.text(cr, inner.x, inner.y + S + S * LABEL_F * 2.6 + S * 0.72,
+ card.notice(cr, inner, colors, 'SLACKWARE', 'no slackware data',
'bin/slackware-sample.sh')
return
end