aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-palette
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-11 17:42:14 +0200
committerDanilo M. <danix@danix.xyz>2026-09-11 17:42:14 +0200
commit90d92490f83156a4a90c44b3837f1037cec80132 (patch)
treee3ab0a62466b72120a63793a886ff19d5e28b8a4 /bin/udt-palette
parent81f7686fe7d8edc5c020f33e8766d4de7c5beccd (diff)
downloadunified-desktop-theme-90d92490f83156a4a90c44b3837f1037cec80132.tar.gz
unified-desktop-theme-90d92490f83156a4a90c44b3837f1037cec80132.zip
feat(palette): move the scheme selection out of the repo
The selector was tracked at palette/roles.conf, which made switching scheme a committable change: the previous commit carried `scheme = tokyo-night` in its diff purely because that was the theme running at the time. Which theme a machine runs is local state, not a property of the project, so the live file is now ~/.config/udt/roles.conf. install.sh seeds it from palette/roles.conf.default on a first run and never overwrites it, so a switch leaves the working tree clean and two machines sharing this repo can run different schemes. udt-palette falls back to the seed when no live file exists, so a bare checkout still generates. This is the one exception to the repo holding the canonical copy of everything, and AGENTS.md says so. Verified: seeding on a missing file, the seed not overwriting an existing choice, generation from the seed alone, and both selftests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015gbjA2bmswN8jyPDKzrvqe
Diffstat (limited to 'bin/udt-palette')
-rwxr-xr-xbin/udt-palette9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/udt-palette b/bin/udt-palette
index b2951c6..60a21fa 100755
--- a/bin/udt-palette
+++ b/bin/udt-palette
@@ -20,6 +20,13 @@ from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
PALETTE_DIR = REPO / "palette"
+# The scheme selection is the user's, not the repo's, so it lives outside the
+# working tree: switching scheme should not show up as a diff, and two machines
+# sharing this repo can run different schemes. install.sh seeds it from
+# palette/roles.conf.default on a first run and never overwrites it after.
+SELECTOR = Path.home() / ".config" / "udt" / "roles.conf"
+SELECTOR_SEED = PALETTE_DIR / "roles.conf.default"
+
def parse_conf(path):
"""Parse `key = value` lines into a dict, preserving order.
@@ -393,7 +400,7 @@ def main(argv):
selftest()
return 0
- roles_path = PALETTE_DIR / "roles.conf"
+ roles_path = SELECTOR if SELECTOR.exists() else SELECTOR_SEED
out_dir = REPO
if "--roles" in argv:
roles_path = Path(argv[argv.index("--roles") + 1]).expanduser()