aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-17 12:40:10 +0200
committerDanilo M. <danix@danix.xyz>2026-09-17 12:40:10 +0200
commit32e10b1d6962afd04a209f300ebb8ab9ee29f070 (patch)
tree9b8e711f00b4ebdb3a6652aef4ffc54a1f36b50a /test
parentf0638bc45a939b28fb32d46e9bbbd8fc2e8cf223 (diff)
downloadconky-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 'test')
-rw-r--r--test/render.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/render.lua b/test/render.lua
index 7d48d0e..3ed5f7e 100644
--- a/test/render.lua
+++ b/test/render.lua
@@ -29,7 +29,9 @@ local sw, sh = 2560, 1080
-- The palette, read from the rendered conky.conf exactly as dashboard.lua
-- does, so the PNG uses the real scheme rather than invented colours.
local function config_colors()
- local path = os.getenv('HOME') .. '/.config/conky/conky.conf'
+ local home = os.getenv('HOME')
+ if not home then return {} end
+ local path = home .. '/.config/conky/conky.conf'
local f = io.open(path, 'r')
if not f then return {} end
local src = f:read('*a')
@@ -79,7 +81,10 @@ if not ok then
os.exit(1)
end
local drew, err = pcall(mod.draw, cr, rect, colors)
-if not drew then print('DRAW ERROR: ' .. tostring(err)) end
+if not drew then
+ print('DRAW ERROR: ' .. tostring(err))
+ os.exit(1)
+end
cairo_destroy(cr)
cairo_surface_write_to_png(surf, out)