0%

Manjaro Sway 命令行提示符挖掘

Manjaro Sway默认的bash提示符看起来类似oh-my-zsh比较美观,简单分析后发现使用了silver

图示

A cross-shell customizable powerline-like prompt heavily inspired by Agnoster. The faster rust port of bronze.

silver是一个跨平台、方便配置的类powerline提示符,从bronze移植而来。bronze是用go开发的,目前已经停止维护了,其git页面上显示用rust写的silver比它快50%,其配置文件通用所以老用户迁移很容易。bronze大量参考了Agnoster这个zsh主题。

目前silver支持 Powershell, Bash, Zsh, fish, Ion 和Elvish。

silver的图标由nerd字体提供。这个字体囊括了常用图标库,比如Font Awesome就包含其中。
diagram

Manjaro Sway中,silver.toml位于~/.config/silver,可根据自身喜好修改。

[[left]]
name = "status"
color.background = "black"
color.foreground = "white"

[[left]]
name = "user"
color.background = "yellow"
color.foreground = "black"

[[left]]
name = "dir"
color.background = "blue"
color.foreground = "black"

[[left]]
name = "git"
color.background = "green"
color.foreground = "black"

[[left]]
name = "cmdtime"
color.background = "magenta"
color.foreground = "black"

需要指出,在bash中,cmdtime不可用,故不会显示。