summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-11 21:59:23 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-11 21:59:23 +1000
commit09f01bfd1dfebea92c2931e617fbc634e03d2b2c (patch)
tree746e53abef6a9dc69e7b05897c4d39caecef16c5 /src
parentscheme: better error messages (diff)
downloadcaelestia-cli-09f01bfd1dfebea92c2931e617fbc634e03d2b2c.tar.gz
caelestia-cli-09f01bfd1dfebea92c2931e617fbc634e03d2b2c.tar.bz2
caelestia-cli-09f01bfd1dfebea92c2931e617fbc634e03d2b2c.zip
feat: theme spicetify
Diffstat (limited to 'src')
-rw-r--r--src/caelestia/data/templates/spicetify.ini17
-rw-r--r--src/caelestia/utils/theme.py11
2 files changed, 27 insertions, 1 deletions
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)