feat(plymouth): boot splash background follows the active palette

themes/engine/plymouth/nomarchy.script had
`Window.SetBackgroundTopColor(0.101, 0.105, 0.149)` hardcoded — a
Tokyo-Night-ish #1a1b26 — and nomarchy.plymouth had a matching
`ConsoleLogBackgroundColor=0x1a1b26`. Both were frozen regardless of
the active nomarchy.system.theme.

Replaced the literals with placeholders (@BG_R@, @BG_G@, @BG_B@,
@BG_HEX@) in the source files. themes/engine/plymouth.nix now reads
the active palette via `nomarchyLib.getPalette
config.nomarchy.system.theme`, converts palette.base00 into three
0.0–1.0 floats (Nix has no floating-point math, so `(byte * 1000) /
255` integer division formatted as `0.XXX`), and `sed`-substitutes
both files during installPhase.

Smoke-built the derivation against the default summer-night palette:

  $ cat .../nomarchy.script | grep BackgroundTopColor
  Window.SetBackgroundTopColor(0.176, 0.207, 0.231);
  $ cat .../nomarchy.plymouth | grep ConsoleLogBackgroundColor
  ConsoleLogBackgroundColor=0x2d353b

Both match the expected byte→float conversion from base00=2d353b.

Closes the "Plymouth theme variants per palette" Next-column item.
`nix flake check --no-build` clean.
This commit is contained in:
Bernardo Magri
2026-05-22 19:27:04 +01:00
parent a14491b1cc
commit 474bc16eb3
3 changed files with 48 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
# Nomarchy Plymouth Theme Script
Window.SetBackgroundTopColor(0.101, 0.105, 0.149);
Window.SetBackgroundBottomColor(0.101, 0.105, 0.149);
Window.SetBackgroundTopColor(@BG_R@, @BG_G@, @BG_B@);
Window.SetBackgroundBottomColor(@BG_R@, @BG_G@, @BG_B@);
logo.image = Image("logo.png");