diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-11 21:42:13 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-11 21:42:13 +1000 |
| commit | 6f7beecdc6de14cf1fd6be9038a86528d2ba52f0 (patch) | |
| tree | 833a5c08ee8a858e98b0b99bc7685c447c8fe31c /src/caelestia/utils/theme.py | |
| parent | toggles: fix sysmon + not toggling ws (diff) | |
| download | caelestia-cli-6f7beecdc6de14cf1fd6be9038a86528d2ba52f0.tar.gz caelestia-cli-6f7beecdc6de14cf1fd6be9038a86528d2ba52f0.tar.bz2 caelestia-cli-6f7beecdc6de14cf1fd6be9038a86528d2ba52f0.zip | |
feat: theme discord
Diffstat (limited to 'src/caelestia/utils/theme.py')
| -rw-r--r-- | src/caelestia/utils/theme.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index 7774472..7940547 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -1,8 +1,9 @@ import json import subprocess +import tempfile from pathlib import Path -from caelestia.utils.paths import config_dir +from caelestia.utils.paths import config_dir, templates_dir def gen_conf(colours: dict[str, str]) -> str: @@ -15,7 +16,7 @@ def gen_conf(colours: dict[str, str]) -> str: def gen_scss(colours: dict[str, str]) -> str: scss = "" for name, colour in colours.items(): - scss += f"${name}: {colour};\n" + scss += f"${name}: #{colour};\n" return scss @@ -81,6 +82,16 @@ def apply_hypr(conf: str) -> None: try_write(config_dir / "hypr/scheme/current.conf", conf) +def apply_discord(scss: str) -> None: + with tempfile.TemporaryDirectory("w") as tmp_dir: + (Path(tmp_dir) / "_colours.scss").write_text(scss) + conf = subprocess.check_output(["sass", "-I", tmp_dir, templates_dir / "discord.scss"], text=True) + + for client in "Equicord", "Vencord", "BetterDiscord", "equicord", "vesktop", "legcord": + try_write(config_dir / client / "themes/caelestia.theme.css", conf) + + def apply_colours(colours: dict[str, str]) -> None: apply_terms(gen_sequences(colours)) apply_hypr(gen_conf(colours)) + apply_discord(gen_scss(colours)) |