diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-17 19:27:13 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-17 19:27:13 +0200 |
| commit | dddeee2d12207fd42a2930de14c8f0b368eede55 (patch) | |
| tree | 1b8898ccccf8444ea122d4991258937c107cb039 /widgets/cache.lua | |
| parent | f0790a43f2b7d94b3847135120bb92782eaa892d (diff) | |
| download | conky-theme-udt-dddeee2d12207fd42a2930de14c8f0b368eede55.tar.gz conky-theme-udt-dddeee2d12207fd42a2930de14c8f0b368eede55.zip | |
feat: show free and total under each disk ring
Replaces the percentage, which the ring already draws as an angle. A number
repeating it costs a row in a column about 75px wide.
Free carries the threshold colour because it is the measured quantity; the
total is fixed and stays in the plain value colour, so each column has one
coloured number.
The cache card adopts card.truncate in the same pass: it was slicing names by
byte, which halves a multi-byte character.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'widgets/cache.lua')
| -rw-r--r-- | widgets/cache.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/widgets/cache.lua b/widgets/cache.lua index 0aeb016..af20347 100644 --- a/widgets/cache.lua +++ b/widgets/cache.lua @@ -42,9 +42,9 @@ function M.draw(cr, rect, colors) local items = c.items or {} local names = {} for i, e in ipairs(items) do - local name = e.name - if #name > 18 then name = name:sub(1, 17) .. '\u{2026}' end - names[i] = name + -- By character, not byte: a cache directory can carry an accented name and + -- a byte slice cuts one in half, which Cairo draws as a replacement box. + names[i] = card.truncate(e.name, 18) end local row_n = #items |
