CommandCodeAI / CommandCodeAI/command-code

Custom theme slot: follow system/desktop theme with live reload

未关闭
#812 3 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

@aliarain 已经在做这个了。

开始于 2026年9月8日。

desktop
主要语言
没有语言数据
星标
4k
派生
350
PR 合并指标
30 天内没有已合并 PR

描述

Feature Description

Command Code to support one extra theme slot called custom. It would read ~/.commandcode/themes/custom/palette.json, layer it over the dark base, and repaint when the file changes. It should work everywhere a theme name works: config, --config theme=, /theme, and the
picker. The watcher should use fs.watch with an mtime poll fallback. And the palette JSON schema should be documented so desktop themes can target it.

Use Case

I run Omarchy. The system already picks one palette and repaints quickshell and the bar on omarchy theme set. Command Code sits outside that. Auto only looks at terminal background, so the TUI never matches the desktop and I have to restart it after a theme switch. A file-backed custom slot would let Omarchy publish its palette once and let Command Code follow it.

Additional Context

I proved this out locally with a patch. A small Python script turns colors.toml into a 77-key palette.json. I tested it on Matte Black and others in dark mode. I map flat keys onto USER_MSG_COLORS, DIFF_COLORS, STATUS_COLORS, TASTE_COLORS, PR_COLORS, MARKDOWN_COLORS, and LOGO_BANNER_COLORS, and the quickshell accent drives the TUI accent. A theme-set hook rewrites palette.json on every system switch. The watcher swaps in a fresh snapshot and calls applyTuiTheme("custom"). It repaints a running session in about two seconds. Partial palettes fall back to base tokens. I can share the scripts. They are bundle patches, not mergeable code, but they pin down the mapping and reload wiring. Open questions are whether this stays separate from auto, who owns per-desktop converters, and how to version the schema.

How important is this to you?

Nice to have

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。