diff options
| author | Batuhan Edgüer <67585935+BestSithInEU@users.noreply.github.com> | 2025-08-16 19:17:39 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-17 02:17:39 +1000 |
| commit | 63e213283008d95832443a717e23cead25f0a7d6 (patch) | |
| tree | dd716ccd2a954db0a929c5157f8abd23736bcd34 | |
| parent | paths: fix custom path envs (diff) | |
| download | caelestia-cli-63e213283008d95832443a717e23cead25f0a7d6.tar.gz caelestia-cli-63e213283008d95832443a717e23cead25f0a7d6.tar.bz2 caelestia-cli-63e213283008d95832443a717e23cead25f0a7d6.zip | |
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
| -rw-r--r-- | src/caelestia/data/templates/warp.yaml | 26 | ||||
| -rw-r--r-- | src/caelestia/utils/theme.py | 11 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/caelestia/data/templates/warp.yaml b/src/caelestia/data/templates/warp.yaml new file mode 100644 index 0000000..36d4c02 --- /dev/null +++ b/src/caelestia/data/templates/warp.yaml @@ -0,0 +1,26 @@ +--- +name: 'Caelestia Theme' +accent: '{{ $primary }}' +background: '{{ $surface }}' +foreground: '{{ $onSurface }}' +details: {{ $warp_mode }} +cursor: '{{ $secondary }}' +terminal_colors: + normal: + black: '{{ $term0 }}' + red: '{{ $term1 }}' + green: '{{ $term2 }}' + yellow: '{{ $term3 }}' + blue: '{{ $term4 }}' + magenta: '{{ $term5 }}' + cyan: '{{ $term6 }}' + white: '{{ $term7 }}' + bright: + black: '{{ $term8 }}' + red: '{{ $term9 }}' + green: '{{ $term10 }}' + yellow: '{{ $term11 }}' + blue: '{{ $term12 }}' + magenta: '{{ $term13 }}' + cyan: '{{ $term14 }}' + white: '{{ $term15 }}' 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) |