aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-palette
diff options
context:
space:
mode:
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()