From 8137155e977f66440bdeac3f5c292d772b481722 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 16 Sep 2026 20:11:27 +0200 Subject: refactor: render the conky template from the dashboard repo The Lua dashboard lives in conky-theme-udt now, so udt-palette renders that repo's conky.conf.in instead of a local template and install.sh links the Lua alongside the config. gen_conky also substitutes critical, for the dashboard's error overlay: conky reports a Lua fault as a blank window, so the dashboard catches it and draws the message instead. The old variables-and-execi template is deleted. Its hardware discovery was not lost; the hwmon glob-by-name approach is carried into lib/data.lua deliberately, since fixed indices drift across kernel reorders. Co-Authored-By: Claude Opus 5 --- bin/udt-palette | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/udt-palette b/bin/udt-palette index 95b9092..7f53e88 100755 --- a/bin/udt-palette +++ b/bin/udt-palette @@ -27,6 +27,9 @@ PALETTE_DIR = REPO / "palette" SELECTOR = Path.home() / ".config" / "udt" / "roles.conf" SELECTOR_SEED = PALETTE_DIR / "roles.conf.default" +# The Lua dashboard lives in its own repo; UDT only renders its colours. +CONKY_REPO = Path("~/Programming/GIT/conky-theme-udt").expanduser() + def parse_conf(path): """Parse `key = value` lines into a dict, preserving order. @@ -543,15 +546,20 @@ def gen_sublime_theme(res, scheme, palette, template): def gen_conky(res, scheme, palette, template): - """conky: substitute into the shipped template. + """conky: substitute into the dashboard template. - conky.text is laid out with absolute ${goto} offsets tuned to label widths, - so it is never regenerated, only its colour block is substituted. + The template lives in the conky-theme-udt repo, which owns the Lua + dashboard; this only fills in the colours. `critical` is included for the + dashboard's error overlay, which draws a caught Lua error on screen because + conky otherwise reports one as a blank window. """ out = template.replace("@SCHEME@", scheme) for role in ("heading", "label", "rule", "value", "highlight", "ok", - "body", "body_outline", "body_shade"): + "body", "body_outline", "body_shade", "critical"): out = out.replace(f"@{role.upper()}@", hex6(res[role])) + # own_window_colour takes '#AARRGGBB', so the window background needs the + # shade colour without its leading '#' to sit after the alpha pair. + out = out.replace("@BODY_SHADE_RAW@", hex6(res["body_shade"]).lstrip("#")) return out @@ -651,7 +659,7 @@ TARGETS = [ ("rofi/udt/palette.rasi", gen_rofi, None), ("templates/waybar/theme.css", gen_waybar, None), ("templates/terminal/kitty-theme.conf", gen_kitty, None), - ("templates/conky.conf", gen_conky, "templates/conky.conf.in"), + (str(CONKY_REPO / "conky.conf"), gen_conky, str(CONKY_REPO / "conky.conf.in")), ("bin/udt_colors.py", gen_accent_py, None), ("templates/homepage/custom.css", gen_homepage, None), ("templates/obsidian/udt.css", gen_obsidian, None), -- cgit v1.2.3