aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-11 18:23:41 +0200
committerDanilo M. <danix@danix.xyz>2026-09-11 18:23:41 +0200
commit1f37c129ac0b72fd2e177618ae6aed5f4233873d (patch)
treed0a6bc9698474207b8ded528f5830c57cde5267f
parent90d92490f83156a4a90c44b3837f1037cec80132 (diff)
downloadunified-desktop-theme-1f37c129ac0b72fd2e177618ae6aed5f4233873d.tar.gz
unified-desktop-theme-1f37c129ac0b72fd2e177618ae6aed5f4233873d.zip
feat(palette): generate the homepage stylesheet and stage it on install
The dashboard's custom.css was written by hand against Macchiato, so it would have drifted the moment the desktop changed scheme. It is now generated from the same roles as everything else and staged on the host by install.sh. Adds four intermediate grey roles to every scheme. homepage wants a full ten-step ramp where the other consumers want three depths, and without them several steps collapsed onto the same colour, flattening the mid-tones. The scp is deliberately soft: five second timeout, BatchMode, a warning rather than a failure when the host is unreachable, so a laptop away from that network still installs the local theme. It stages to ~/hp-stage only, because /opt/homepage/config is root-owned; install.sh prints the sudo copy to finish. Verified: the generated Macchiato stylesheet reproduces the deployed one colour-for-colour, switching to tokyo-night propagates through to the staged file, and a failing scp leaves install.sh exiting 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015gbjA2bmswN8jyPDKzrvqe
-rw-r--r--AGENTS.md11
-rwxr-xr-xbin/udt-palette66
-rwxr-xr-xinstall.sh16
-rw-r--r--palette/roles-dracula.conf7
-rw-r--r--palette/roles-macchiato.conf7
-rw-r--r--palette/roles-nord.conf7
-rw-r--r--palette/roles-tokyo-night.conf7
-rw-r--r--templates/homepage/custom.css42
8 files changed, 162 insertions, 1 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 0665bb9..49f0802 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -34,7 +34,16 @@ Generated files are gitignored, because tracking them would turn every scheme
switch into a diff. Editing one is pointless: the next install overwrites it.
The generated set is `rofi/udt/palette.rasi`, `templates/dunstrc`,
`templates/conky.conf`, `templates/waybar/theme.css`,
-`templates/terminal/kitty-theme.conf` and `bin/udt_colors.py`. The last is
+`templates/terminal/kitty-theme.conf`, `templates/homepage/custom.css` and
+`bin/udt_colors.py`.
+
+The homepage stylesheet is the one output that leaves this machine.
+`install.sh` scp's it to `homepage:hp-stage/`, with a five second timeout and a
+warning rather than a failure when the host is down, so installing the local
+theme still works off that network. It stages only: `/opt/homepage/config` is
+root-owned, and the final copy plus a `systemctl restart homepage` is a manual
+step the script prints. homepage's `settings.yaml` must keep `color: gray`, the
+theme class the generated CSS targets. The last is
imported by `udt-accent`, which is why its accent table follows the scheme.
Roles are a flat namespace, so a name collides across sections: conky's outline
diff --git a/bin/udt-palette b/bin/udt-palette
index 60a21fa..1a1c6b0 100755
--- a/bin/udt-palette
+++ b/bin/udt-palette
@@ -206,6 +206,71 @@ def gen_kitty(res, scheme, palette):
return "\n".join(lines) + "\n"
+def gen_homepage(res, scheme, palette):
+ """gethomepage: a custom.css overriding its ten-step colour ramp.
+
+ homepage themes itself with --color-50 (lightest) to --color-900 (darkest)
+ as space-separated RGB triples, so the ramp is filled from the text scale
+ at the light end and the surface scale at the dark end.
+
+ The card backgrounds do NOT come from that ramp: in dark mode the service
+ and bookmark cards carry `dark:bg-white/5`, a literal white, so redefining
+ the variables alone leaves them a neutral grey. Upstream hits the same wall
+ and hardcodes those selectors for .theme-white; this does the same for
+ .theme-gray, which is the class settings.yaml's `color: gray` puts on the
+ page. Change that setting and this file stops applying.
+ """
+ def triple(role):
+ r, g, b, _ = res[role]
+ return f"{r} {g} {b}"
+
+ ramp = [("50", "fg"), ("100", "fg_bright"), ("200", "fg_dim"),
+ ("300", "mid_high"), ("400", "mid_low"), ("500", "fg_faint"),
+ ("600", "surface_high"), ("700", "surface_alt"), ("800", "surface"),
+ ("900", "bg")]
+ rows = "\n".join(f" --color-{n}: {triple(role)};" for n, role in ramp)
+
+ sr, sg, sb, _ = res["surface"]
+ ar, ag, ab, _ = res["surface_alt"]
+ br, bg_, bb, _ = res["bg"]
+ accent = hex6(res["accent"])
+
+ return f"""/* {BANNER.format(scheme=scheme)}
+ *
+ * Catppuccin-independent: every colour here comes from palette/roles-{scheme}
+ * .conf, so this file follows the desktop rather than restating a palette.
+ */
+
+.theme-gray {{
+{rows}
+
+ --color-logo-start: {triple('accent')};
+ --color-logo-stop: {triple('info')};
+}}
+
+/* Card backgrounds, which the ramp does not reach. See the note above. */
+.theme-gray .bg-theme-100\\/20:not([class^="backdrop-blur"]),
+.theme-gray .dark\\:bg-white\\/5:not([class^="backdrop-blur"]) {{
+ background-color: rgb({sr} {sg} {sb} / 55%);
+}}
+
+.theme-gray .bg-theme-100\\/20:hover:not([class^="backdrop-blur"]),
+.theme-gray .dark\\:bg-white\\/5:hover:not([class^="backdrop-blur"]) {{
+ background-color: rgb({ar} {ag} {ab} / 70%);
+}}
+
+.theme-gray .bg-theme-900\\/50:not([class^="backdrop-blur"]) {{
+ background-color: rgb({br} {bg_} {bb} / 50%);
+}}
+
+/* Accent on secondary labels. Fixed, not wallpaper-tracking: this runs on a
+ * server with no wallpaper to read. */
+.theme-gray .text-theme-500 {{
+ color: {accent};
+}}
+"""
+
+
def gen_dunst(res, scheme, palette, template):
"""dunst: substitute colours into the shipped template.
@@ -331,6 +396,7 @@ TARGETS = [
("templates/dunstrc", gen_dunst, "templates/dunstrc.in"),
("templates/conky.conf", gen_conky, "templates/conky.conf.in"),
("bin/udt_colors.py", gen_accent_py, None),
+ ("templates/homepage/custom.css", gen_homepage, None),
]
diff --git a/install.sh b/install.sh
index 9b849a3..5969c48 100755
--- a/install.sh
+++ b/install.sh
@@ -61,5 +61,21 @@ fi
install -Dm644 "$repo/templates/terminal/kitty-theme.conf" \
"$HOME/.config/kitty/current-theme.conf"
+# Stage the homepage stylesheet on the dashboard host. Staged, not installed:
+# /opt/homepage/config is root-owned and this script does not hold root there.
+# Never fatal, and never slow: a laptop away from that network must still be
+# able to install the local theme, so the connect timeout is short and any
+# failure is a warning.
+if command -v scp >/dev/null 2>&1; then
+ if scp -q -o ConnectTimeout=5 -o BatchMode=yes \
+ "$repo/templates/homepage/custom.css" \
+ homepage:hp-stage/custom.css 2>/dev/null; then
+ echo "homepage: staged custom.css ($scheme)"
+ echo " finish with: ssh homepage 'sudo cp ~/hp-stage/custom.css /opt/homepage/config/custom.css'"
+ else
+ echo "homepage: unreachable, skipped" >&2
+ fi
+fi
+
echo "installed:"
ls -l "$target" "$HOME/bin/udt-accent"
diff --git a/palette/roles-dracula.conf b/palette/roles-dracula.conf
index 40aa2a6..ea3d71f 100644
--- a/palette/roles-dracula.conf
+++ b/palette/roles-dracula.conf
@@ -87,6 +87,13 @@ bright_magenta = pink
bright_cyan = cyan
bright_white = foreground
+# Intermediate greys, for consumers that want a full ramp rather than
+# three depths. homepage's --color-50..900 is the only one so far.
+fg_bright = foreground
+mid_high = comment
+mid_low = surface_high
+surface_high = current_line
+
# kitty extras: marks, scrollbar, bell, tab bar ground.
mark1 = purple
mark2 = pink
diff --git a/palette/roles-macchiato.conf b/palette/roles-macchiato.conf
index 0a34f03..f5d12ea 100644
--- a/palette/roles-macchiato.conf
+++ b/palette/roles-macchiato.conf
@@ -99,6 +99,13 @@ bright_magenta = pink
bright_cyan = teal
bright_white = subtext0
+# Intermediate greys, for consumers that want a full ramp rather than
+# three depths. homepage's --color-50..900 is the only one so far.
+fg_bright = subtext1
+mid_high = overlay2
+mid_low = overlay1
+surface_high = surface2
+
# kitty extras: marks, scrollbar, bell, tab bar ground.
mark1 = lavender
mark2 = mauve
diff --git a/palette/roles-nord.conf b/palette/roles-nord.conf
index b04e9c8..b79e6f4 100644
--- a/palette/roles-nord.conf
+++ b/palette/roles-nord.conf
@@ -87,6 +87,13 @@ bright_magenta = aurora_purple
bright_cyan = frost_teal
bright_white = nord6
+# Intermediate greys, for consumers that want a full ramp rather than
+# three depths. homepage's --color-50..900 is the only one so far.
+fg_bright = nord5
+mid_high = nord4
+mid_low = nord3
+surface_high = nord2
+
# kitty extras: marks, scrollbar, bell, tab bar ground.
mark1 = frost_cyan
mark2 = aurora_purple
diff --git a/palette/roles-tokyo-night.conf b/palette/roles-tokyo-night.conf
index fb54926..d56659c 100644
--- a/palette/roles-tokyo-night.conf
+++ b/palette/roles-tokyo-night.conf
@@ -86,6 +86,13 @@ bright_magenta = purple
bright_cyan = blue1
bright_white = fg
+# Intermediate greys, for consumers that want a full ramp rather than
+# three depths. homepage's --color-50..900 is the only one so far.
+fg_bright = fg_dark
+mid_high = comment
+mid_low = terminal_black
+surface_high = bg_visual
+
# kitty extras: marks, scrollbar, bell, tab bar ground.
mark1 = blue
mark2 = magenta
diff --git a/templates/homepage/custom.css b/templates/homepage/custom.css
new file mode 100644
index 0000000..5256358
--- /dev/null
+++ b/templates/homepage/custom.css
@@ -0,0 +1,42 @@
+/* Generated by udt-palette from palette/tokyo-night.conf. Do not edit.
+ *
+ * Catppuccin-independent: every colour here comes from palette/roles-tokyo-night
+ * .conf, so this file follows the desktop rather than restating a palette.
+ */
+
+.theme-gray {
+ --color-50: 192 202 245;
+ --color-100: 169 177 214;
+ --color-200: 169 177 214;
+ --color-300: 86 95 137;
+ --color-400: 65 72 104;
+ --color-500: 86 95 137;
+ --color-600: 40 52 87;
+ --color-700: 40 52 87;
+ --color-800: 41 46 66;
+ --color-900: 26 27 38;
+
+ --color-logo-start: 122 162 247;
+ --color-logo-stop: 125 207 255;
+}
+
+/* Card backgrounds, which the ramp does not reach. See the note above. */
+.theme-gray .bg-theme-100\/20:not([class^="backdrop-blur"]),
+.theme-gray .dark\:bg-white\/5:not([class^="backdrop-blur"]) {
+ background-color: rgb(41 46 66 / 55%);
+}
+
+.theme-gray .bg-theme-100\/20:hover:not([class^="backdrop-blur"]),
+.theme-gray .dark\:bg-white\/5:hover:not([class^="backdrop-blur"]) {
+ background-color: rgb(40 52 87 / 70%);
+}
+
+.theme-gray .bg-theme-900\/50:not([class^="backdrop-blur"]) {
+ background-color: rgb(26 27 38 / 50%);
+}
+
+/* Accent on secondary labels. Fixed, not wallpaper-tracking: this runs on a
+ * server with no wallpaper to read. */
+.theme-gray .text-theme-500 {
+ color: #7aa2f7;
+}