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:
Yuka
2026-04-12 15:28:44 +08:00
committed by GitHub
parent 7f59ca9656
commit e1531f3c9e
2 changed files with 471 additions and 0 deletions
+14
View File
@@ -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)