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 prompt to run silver prompt
, which outputs the actual prompt. The silver prompt
command relies on environment variables for configuration.
Since silver is not written in shell script, it should theoretically be compatible with any shell, but the three supported shells are Bash, Zsh, and fish.
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 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
- add
alias date="gdate"
to your shell rc
Now that you have silver installed, you need to configure it. To have your prompt look like the one in the screenshot above, add this to your ~/.bashrc
/~/.zshrc
:
SILVER=(status:black:white dir:blue:black git:green:black cmdtime:magenta:black)
export SILVER_SHELL=$0 # bash, zsh, or fish
Or add the following to your ~/.config/fish/config.fish
:
set SILVER status:black:white dir:blue:black git:green:black cmdtime:magenta:black
set -x SILVER_SHELL fish
Now that silver is configured, you need to evaluate its bootstrap code.
~/.bashrc
/~/.zshrc
:
eval "$(silver init)"
~/.config/fish/config.fish
:
eval (silver init)
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
icons.rs
- processes icons, separators, and Unicode
init.bash
- bootstrap code for Bash
init.fish
- bootstrap code for fish
init.zsh
- bootstrap code for Zsh
main.rs
- parses command line arguments
print.rs
- prints prompt segments
sh.rs
- shell-specific code