A cross-shell customizable powerline-like prompt heavily inspired by Agnoster. The faster rust port of bronze.
Unlike most shell prompts, silver is not written in shell script, but entirely in Rust.
When silver init
is run, it outputs shell code that sets your left prompt to run silver lprompt
and right prompt to silver rprompt
, which output the actual prompt.
Since silver is not written in shell script, it should theoretically be compatible with any shell, but the supported shells are Powershell, Bash, Zsh, fish, Ion and Elvish.
To be able to use the custom icons (which are enabled by default), you must patch your font or install a pre-patched font from Nerd Fonts.
- install and setup Rust
- run
cargo install --git https://github.com/reujab/silver
- download a binary on the releases page
- add binary to
PATH
environment variable
On macOS, you will have to do a bit more:
- install Homebrew
- run
brew install coreutils
- run
brew install openssl
- add
alias date="gdate"
to your shell config
Now that you have silver installed, you need to configure it. To have your prompt look like the one in the screenshot above, create silver.toml
with the following content:
[[left]]
name = "dir"
color.background = "blue"
color.foreground = "black"
[[left]]
name = "git"
color.background = "green"
color.foreground = "black"
[[right]]
name = "status"
color.background = "white"
color.foreground = "black"
[[right]]
name = "cmdtime"
color.background = "magenta"
color.foreground = "black"
[[right]]
name = "shell"
color.background = "green"
color.foreground = "black"
Now that silver is configured, you need to evaluate its bootstrap code.
~/.bashrc
:
source <(silver init)
~/.config/ion/initrc
:
eval $(silver init)
Invoke-Expression -Command $(silver init | Out-String)
See zsh plugin
See fish plugin
See elvish plugin
Documentation is available on the wiki.
src/
modules/
cmdtime.rs
- source code for the
cmdtime
module
- source code for the
dir.rs
- source code for the
dir
module
- source code for the
env.rs
- source code for the
env
module
- source code for the
git.rs
- source code for the
git
module
- source code for the
mod.rs
- handles modules
os.rs
- source code for the
os
module
- source code for the
status.rs
- source code for the
status
module
- source code for the
time.rs
- source code for the
time
module
- source code for the
user.rs
- source code for the
user
module
- source code for the
virtualenv.rs
- source code for the
virtualenv
module
- source code for the
cli.rs
- parses command line arguments
config.rs
- parses TOML
icons.rs
- processes icons, separators, and Unicode
init.bash
- bootstrap code for Bash
init.ion
- bootstrap code for Ion
init.ps1
- bootstrap code for Powershell
main.rs
- does all the magic
print.rs
- prints prompt segments
sh.rs
- shell-specific code