diff options
Diffstat (limited to 'bin/udt-palette')
| -rwxr-xr-x | bin/udt-palette | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/bin/udt-palette b/bin/udt-palette index 6a15a52..00e3092 100755 --- a/bin/udt-palette +++ b/bin/udt-palette @@ -30,6 +30,7 @@ SELECTOR_SEED = PALETTE_DIR / "roles.conf.default" # The Lua dashboard lives in its own repo; UDT only renders its colours. # A sibling checkout, like waybar-theme-udt; skipped when it is not cloned. CONKY_REPO = REPO.parent / "conky-theme-udt" +GRUB_REPO = REPO.parent / "grub-theme-udt" def parse_conf(path): @@ -688,6 +689,20 @@ def gen_conky(res, scheme, palette, template): return out +def gen_grub(res, scheme, palette, template): + """GRUB: substitute into the theme template in the grub-theme-udt repo. + + theme.txt has no include, so the colours are baked in. The accent is the + scheme's fixed one: nothing at boot can read the wallpaper. The PNG slices + that carry colour are drawn by that repo's build script from this output. + """ + out = template.replace("@SCHEME@", scheme) + for role in ("bg", "bg_alt", "bg_deep", "surface", "fg", "fg_dim", + "fg_faint", "accent"): + out = out.replace(f"@{role.upper()}@", hex6(res[role])) + return out + + def gen_accent_py(res, scheme, palette, snap_names): """The accent table and Macchiato dict udt-accent carries for Firefox. @@ -787,6 +802,7 @@ TARGETS = [ ("templates/hyprlock/hyprlock-palette.conf", gen_hyprlock, None), ("templates/nvim/udt.lua", gen_nvim, None), (str(CONKY_REPO / "conky.conf"), gen_conky, str(CONKY_REPO / "conky.conf.in")), + (str(GRUB_REPO / "theme.txt"), gen_grub, str(GRUB_REPO / "theme.txt.in")), ("bin/udt_colors.py", gen_accent_py, None), ("templates/homepage/custom.css", gen_homepage, None), ("templates/obsidian/udt.css", gen_obsidian, None), @@ -817,9 +833,9 @@ def generate(roles_path, out_dir, scheme=None): scheme, palette, res, snap_names = load(roles_path, scheme=scheme) written = [] for target, fn, template in TARGETS: - # A sibling repo that is not cloned here is not an error: its - # template is missing too, and there is nothing to theme. - if Path(target).is_absolute() and not Path(target).parent.is_dir(): + # A sibling repo that is not cloned here, or has no template yet, is + # not an error: there is nothing to theme. + if Path(target).is_absolute() and not (template and Path(template).exists()): continue # A target outside this repo (the conky dashboard) is an absolute path, # and `out_dir / absolute` discards out_dir entirely. For the real |
