diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-11 22:25:03 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-11 22:25:03 +1000 |
| commit | b08858191cf6e3acda33afbd532b743ad6d0f808 (patch) | |
| tree | 2dfb9b4747383fe8d23458661ee89330dd520f34 /src/caelestia/utils/theme.py | |
| parent | feat: theme fuzzel (diff) | |
| download | caelestia-cli-b08858191cf6e3acda33afbd532b743ad6d0f808.tar.gz caelestia-cli-b08858191cf6e3acda33afbd532b743ad6d0f808.tar.bz2 caelestia-cli-b08858191cf6e3acda33afbd532b743ad6d0f808.zip | |
feat: theme btop
Also change template replacement format
Diffstat (limited to 'src/caelestia/utils/theme.py')
| -rw-r--r-- | src/caelestia/utils/theme.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index c4e9899..7f29637 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -19,10 +19,10 @@ def gen_scss(colours: dict[str, str]) -> str: return scss -def gen_replace(colours: dict[str, str], template: Path) -> str: +def gen_replace(colours: dict[str, str], template: Path, hash: bool = False) -> str: template = template.read_text() for name, colour in colours.items(): - template = template.replace(f"${name}", colour) + template = template.replace(f"{{{{ ${name} }}}}", f"#{colour}" if hash else colour) return template @@ -107,9 +107,16 @@ def apply_fuzzel(colours: dict[str, str]) -> None: try_write(config_dir / "fuzzel/fuzzel.ini", template) +def apply_btop(colours: dict[str, str]) -> None: + template = gen_replace(colours, templates_dir / "btop.theme", hash=True) + try_write(config_dir / "btop/themes/caelestia.theme", template) + subprocess.run(["killall", "-USR2", "btop"]) + + 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) apply_fuzzel(colours) + apply_btop(colours) |