跳转到内容

自定义主题

Switch to Zen Mode

除了 4 款内置主题外,你可以通过创建 TOML 文件来定义自己的主题。

~/.config/mutsumi/themes/ 目录下创建 .toml 文件:

Terminal window
mkdir -p ~/.config/mutsumi/themes
~/.config/mutsumi/themes/my-theme.toml
[meta]
name = "My Custom Theme"
author = "your-name"
[colors]
background = "#1e1e2e"
foreground = "#cdd6f4"
accent = "#94e2d5"
muted = "#6c7086"
error = "#f38ba8"
warning = "#fab387"
success = "#a6e3a1"
[priority_colors]
high = "#f38ba8"
normal = "#cdd6f4"
low = "#6c7086"
[tag_colors]
dev = "#89b4fa"
bugfix = "#f38ba8"
life = "#a6e3a1"
docs = "#fab387"
# 未匹配的标签使用 accent 色
字段类型必填说明
namestring主题显示名称
authorstring作者
字段说明
background整体背景色
foreground主文字色
accent点缀/品牌色
muted次要/灰色文字
error错误色
warning警告色
success成功色
字段说明
high高优先级颜色
normal普通优先级颜色
low低优先级颜色

为特定标签指定颜色。键名即标签名,值为十六进制颜色。未列出的标签使用 accent 色。

config.toml 中将 theme 设为主题文件名(不含 .toml 后缀):

theme = "my-theme"

Mutsumi 会按以下顺序查找主题:

  1. 内置主题(monochrome-zennorddraculasolarized
  2. ~/.config/mutsumi/themes/ 下的自定义主题文件
~/.config/mutsumi/themes/catppuccin-mocha.toml
[meta]
name = "Catppuccin Mocha"
author = "community"
[colors]
background = "#1e1e2e"
foreground = "#cdd6f4"
accent = "#89b4fa"
muted = "#585b70"
error = "#f38ba8"
warning = "#fab387"
success = "#a6e3a1"
[priority_colors]
high = "#f38ba8"
normal = "#a6adc8"
low = "#585b70"
[tag_colors]
dev = "#89b4fa"
bugfix = "#f38ba8"
life = "#a6e3a1"
docs = "#f9e2af"
urgent = "#eba0ac"

然后在 config.toml 中使用:

theme = "catppuccin-mocha"

如果只想改变内置主题的点缀色,无需创建完整主题文件。未来版本将支持:

theme = "monochrome-zen"
# accent_color = "#ff79c6" # 覆盖点缀色(规划中)