下载 oh-my-posh

从 Github手动下载到sr/local/bin 或通过 shell 终端下载

https://github.com/JanDeDobbeleer/oh-my-posh

wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v25.4.2/posh-android-arm -O /usr/local/bin/oh-my-posh

chmod +x /usr/local/bin/oh-my-posh

测试 oh-my-posh 是否正常

新开终端 tab,输入 oh-my-posh 如果正常输出 help信息,那么就 ok

下载主题文件

wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip

unzip ~/.poshthemes/themes.zip

chmod u+rw ~/.poshthemes/*.omp.*

rm -rf ~/.poshthemes/themes.zip

oh-my-posh 所有的主题效果见官网:

https://ohmyposh.dev/docs/themes#star

测试主题效果:

oh-my-posh init fish --config ~/.poshthemes/star.omp.json | source

确定效果配置 fish

# 编辑配置文件
 vim ~/.config/fish/config.fish
# 追加posh配置
oh-my-posh init fish --config ~/.poshthemes/star.omp.json | source