From 63e213283008d95832443a717e23cead25f0a7d6 Mon Sep 17 00:00:00 2001 From: Batuhan Edgüer <67585935+BestSithInEU@users.noreply.github.com> Date: Sat, 16 Aug 2025 19:17:39 +0300 Subject: theme: add Warp terminal theme support (#42) * theme: add Warp terminal theme support Add support for Warp terminal theming with proper template and integration. - Add warp.yaml template with standard theme variables - Implement apply_warp function with correct 'darker'/'lighter' values - Integrate with main theme application pipeline via enableWarp config * warp: improve theme generation and use proper data directory - Use gen_replace with hash=True for consistent color formatting - Remove # symbols from template to avoid double hashes - Replace warp_mode manually after gen_replace instead of adding to colors dict - Use data_dir for XDG-compliant theme location --- src/caelestia/utils/theme.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/caelestia/utils/theme.py') diff --git a/src/caelestia/utils/theme.py b/src/caelestia/utils/theme.py index b3261d8..43c19eb 100644 --- a/src/caelestia/utils/theme.py +++ b/src/caelestia/utils/theme.py @@ -7,6 +7,7 @@ from caelestia.utils.colour import get_dynamic_colours from caelestia.utils.paths import ( c_state_dir, config_dir, + data_dir, templates_dir, theme_dir, user_config_path, @@ -184,6 +185,14 @@ general="Sans Serif,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" write_file(config_dir / f"qt{ver}ct/qt{ver}ct.conf", conf) +def apply_warp(colours: dict[str, str], mode: str) -> None: + warp_mode = "darker" if mode == "dark" else "lighter" + + template = gen_replace(colours, templates_dir / "warp.yaml", hash=True) + template = template.replace("{{ $warp_mode }}", warp_mode) + write_file(data_dir / "warp-terminal/themes/caelestia.yaml", template) + + def apply_user_templates(colours: dict[str, str]) -> None: if not user_templates_dir.is_dir(): return @@ -219,4 +228,6 @@ def apply_colours(colours: dict[str, str], mode: str) -> None: apply_gtk(colours, mode) if check("enableQt"): apply_qt(colours, mode) + if check("enableWarp"): + apply_warp(colours, mode) apply_user_templates(colours) -- cgit v1.2.3-freya