From 09f01bfd1dfebea92c2931e617fbc634e03d2b2c Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:59:23 +1000 Subject: feat: theme spicetify --- src/caelestia/data/templates/spicetify.ini | 17 +++++++++++++++++ src/caelestia/utils/theme.py | 11 ++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/caelestia/data/templates/spicetify.ini (limited to 'src') diff --git a/src/caelestia/data/templates/spicetify.ini b/src/caelestia/data/templates/spicetify.ini new file mode 100644 index 0000000..839f30d --- /dev/null +++ b/src/caelestia/data/templates/spicetify.ini @@ -0,0 +1,17 @@ +[caelestia] +text = $text ; Main text colour +subtext = $subtext0 ; Subtext colour +main = $base ; Panel backgrounds +highlight = $primary ; Doesn't seem to do anything +misc = $primary ; Doesn't seem to do anything +notification = $overlay0 ; Notifications probably +notification-error = $error ; Error notifications probably +shadow = $mantle ; Shadow for covers, context menu, also affects playlist/artist banners +card = $surface0 ; Context menu and tooltips +player = $base ; Doesn't seem to do anything +sidebar = $mantle ; Background +main-elevated = $surface0 ; Higher layers than main, e.g. search bar +selected-row = $text ; Selections, hover, other coloured text and slider background +button = $primary ; Slider and text buttons +button-active = $primary ; Background buttons +button-disabled = $overlay0 ; Disabled buttons diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index 7940547..acca868 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -1,4 +1,3 @@ -import json import subprocess import tempfile from pathlib import Path @@ -91,7 +90,17 @@ def apply_discord(scss: str) -> None: try_write(config_dir / client / "themes/caelestia.theme.css", conf) +def apply_spicetify(colours: dict[str, str]) -> None: + template = (templates_dir / "spicetify.ini").read_text() + + for name, colour in colours.items(): + template = template.replace(f"${name}", colour) + + try_write(config_dir / "spicetify/Themes/caelestia/color.ini", template) + + def apply_colours(colours: dict[str, str]) -> None: apply_terms(gen_sequences(colours)) apply_hypr(gen_conf(colours)) apply_discord(gen_scss(colours)) + apply_spicetify(colours) -- cgit v1.2.3-freya