forked from Shinonome/caelestia-cli
theme: add zed editor theme support (#102)
- Add Zed theme template (zed.json) with full Material You syntax highlighting, UI colors, and terminal ANSI palette - Apply theme via file overwrite instead of restarting Zed, so Zed's file watcher picks up changes automatically - Resolve symlinks in apply_zed() only before writing, since Zed's file watcher does not detect changes through symlinks (other themed apps that rely on symlinks are unaffected)
This commit is contained in:
@@ -339,6 +339,18 @@ def apply_warp(colours: dict[str, str], mode: str) -> None:
|
||||
write_file(data_dir / "warp-terminal/themes/caelestia.yaml", template)
|
||||
|
||||
|
||||
@log_exception
|
||||
def apply_zed(colours: dict[str, str], mode: str) -> None:
|
||||
theme_path = config_dir / "zed/themes/caelestia.json"
|
||||
# Zed's file watcher does not detect changes through symlinks,
|
||||
# so resolve to a regular file before writing
|
||||
if theme_path.is_symlink():
|
||||
theme_path.unlink()
|
||||
|
||||
content = gen_replace_dynamic(colours, templates_dir / "zed.json", mode)
|
||||
write_file(theme_path, content)
|
||||
|
||||
|
||||
@log_exception
|
||||
def apply_cava(colours: dict[str, str]) -> None:
|
||||
template = gen_replace(colours, templates_dir / "cava.conf", hash=True)
|
||||
@@ -401,6 +413,8 @@ def apply_colours(colours: dict[str, str], mode: str) -> None:
|
||||
apply_qt(colours, mode)
|
||||
if check("enableWarp"):
|
||||
apply_warp(colours, mode)
|
||||
if check("enableZed"):
|
||||
apply_zed(colours, mode)
|
||||
if check("enableCava"):
|
||||
apply_cava(colours)
|
||||
apply_user_templates(colours, mode)
|
||||
|
||||
Reference in New Issue
Block a user