最近看上了一款终端 Otty,非常喜欢它的配色,但是又习惯了 Ghostty,不愿意换,就想着把把 Otty 的配色移植到 Ghostty。
仅还原终端颜色,不包括 Otty 的侧栏、标签页等界面。
1. 创建主题文件
在 Ghostty 中运行:
mkdir -p ~/.config/ghostty/themes
touch ~/.config/ghostty/themes/"Otty Paper"
open -e ~/.config/ghostty/themes/"Otty Paper"
打开的文件中粘贴:
palette = 0=#1a1a1a
palette = 1=#a33a3a
palette = 2=#2b5a38
palette = 3=#a85a20
palette = 4=#4a7a8a
palette = 5=#4a3a6a
palette = 6=#3a7a6a
palette = 7=#c1beb5
palette = 8=#8c8a80
palette = 9=#c36a6a
palette = 10=#6b9a78
palette = 11=#c88a50
palette = 12=#7a9aaa
palette = 13=#8a7a9a
palette = 14=#6abaaa
palette = 15=#ebebe6
background = #fcfbf9
foreground = #1a1a1a
cursor-color = #1a1a1a
cursor-text = #fcfbf9
selection-background = #e0dfd5
selection-foreground = #1a1a1a
按 ⌘S 保存。确认文件名是 Otty Paper,没有 .txt 后缀。
2. 启用主题
回到 Ghostty,按 ⌘, 打开配置文件,加入:
theme = Otty Paper
如果已有其他 theme = ...,直接替换。
3. 生效
按 ⌘⇧, 重新加载配置。
如果没有生效
检查配置中是否还有 background、foreground、palette、cursor-color 或 selection-*。这些设置会覆盖主题颜色。
仍未生效时,完全退出 Ghostty 后重新打开。
Windows
Ghostty 暂不支持 Windows,因此无法在 Windows 上按本教程配置。