Skip to content

reujab/silver

Repository files navigation

silver

Join the chat at https://gitter.im/reujab-silver/community

Packaging status

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

How does it work?

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.

Getting started

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.

Icons

To be able to use the custom icons (which are disabled by default), you must patch your font or install a pre-patched font from Nerd Fonts.

Installation

From source

  • install and setup Rust
  • run cargo install --git https://github.com/reujab/silver

From pre-compiled binary

  • download a binary on the releases page
  • add binary to PATH environment variable

macOS prerequisite

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

Configuration

Now that you have silver installed, you need to create silver.toml and put it in the following path:

  • Linux: ~/.config/silver/silver.toml or $XDG_CONFIG_HOME/silver/silver.toml
  • macOS: ~/Library/Preferences/rs.silver/silver.toml

To have your prompt look like the screenshot at the top of the readme, configure silver.toml with:

[[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.

Bash

~/.bashrc:

source <(silver init)

Ion

~/.config/ion/initrc:

eval $(silver init)

Powershell

Invoke-Expression -Command $(silver init | Out-String)

Zsh

See zsh plugin

Fish

See fish plugin

Elvish

See elvish plugin

Documentation

Documentation is available on the wiki.

Project structure