diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-17 12:40:10 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-17 12:40:10 +0200 |
| commit | 32e10b1d6962afd04a209f300ebb8ab9ee29f070 (patch) | |
| tree | 9b8e711f00b4ebdb3a6652aef4ffc54a1f36b50a /lib/card.lua | |
| parent | f0638bc45a939b28fb32d46e9bbbd8fc2e8cf223 (diff) | |
| download | conky-theme-udt-32e10b1d6962afd04a209f300ebb8ab9ee29f070.tar.gz conky-theme-udt-32e10b1d6962afd04a209f300ebb8ab9ee29f070.zip | |
fix: stop the widgets from stalling or raising the draw
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.
Diffstat (limited to 'lib/card.lua')
| -rw-r--r-- | lib/card.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/card.lua b/lib/card.lua index 48a7f2e..185703c 100644 --- a/lib/card.lua +++ b/lib/card.lua @@ -213,7 +213,7 @@ function M.human(bytes) local units = { 'B', 'K', 'M', 'G', 'T', 'P' } local i = 1 while n >= 1024 and i < #units do n = n / 1024; i = i + 1 end - if i == 1 then return string.format('%d%s', n, units[i]) end + if i == 1 then return string.format('%d%s', math.floor(n), units[i]) end if n >= 100 then return string.format('%.0f%s', n, units[i]) end return string.format('%.1f%s', n, units[i]) end |
