diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-17 19:51:46 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-17 19:51:46 +0200 |
| commit | 6aee635dd0cc5bab4fe3a989e41cea7faa75a9e1 (patch) | |
| tree | 4e77fbd2bbb94f2f0edba391ae35136aa59e27f3 | |
| parent | 629a87b7dfed8eacb5f05ae7f16d5af8ce4310b9 (diff) | |
| download | conky-theme-udt-6aee635dd0cc5bab4fe3a989e41cea7faa75a9e1.tar.gz conky-theme-udt-6aee635dd0cc5bab4fe3a989e41cea7faa75a9e1.zip | |
feat: give the CPU and board rows their own accents
The two rows name two different pieces of hardware and read as one block in a
single colour. heading and highlight are the palette roles that carry no state
meaning, so they can stand for an identity; ok/warning/critical could not,
since those say how something is doing and these strings never change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| -rw-r--r-- | widgets/system.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/widgets/system.lua b/widgets/system.lua index 03cd70a..d4f6188 100644 --- a/widgets/system.lua +++ b/widgets/system.lua @@ -102,16 +102,23 @@ function M.draw(cr, rect, colors) -- The hardware this card is about, under the header. Truncated by character, -- never by byte: a model string can carry a multi-byte character and half of -- one draws as a replacement box. + -- Two accents rather than one label colour: the rows name two different + -- pieces of hardware, and giving each its own hue separates them at a glance + -- without a prefix like 'CPU:' eating the width. `heading` and `highlight` + -- are the two roles that carry no state meaning, so they can stand for an + -- identity; ok/warning/critical could not, since those say how something is + -- doing and these strings never change. local id_y = y + big_size + row_size * 0.2 if cpu_txt or board_txt then card.font(cr, card.FONT_MONO, row_size, false) - card.rgba(cr, colors.label) local id_limit = math.max(8, math.floor(inner.w / (row_size * 0.55))) if cpu_txt then + card.rgba(cr, colors.heading) card.text(cr, inner.x, id_y, card.truncate(cpu_txt, id_limit)) id_y = id_y + row_size * 1.5 end if board_txt then + card.rgba(cr, colors.highlight) card.text(cr, inner.x, id_y, card.truncate(board_txt, id_limit)) id_y = id_y + row_size * 1.5 end |
