mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-10 01:09:28 -05:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user