~fmac/corylus

ref: de4f1e6d874ace241f56dce6c040d8e9e1ef1c0b corylus/README.md -rw-r--r-- 1003 bytes
de4f1e6d — Francesco Camuffo Say how to contribute 6 months ago

#Corylus

Simple shell prompt generator in Go.

#Usage

Corylus expects strings as arguments. If an argument matches the name of a known segment generator, then the result will be appended. If an argument does not match any generator then it is appended as string.


Edit the prompt variable in your shell configuration file, probably .bashrc, .zshrc or .profile. For ZSH you may need to enable the prompt expansion by adding setopt PROMPT_SUBST to your .zshrc.


At the moment the available segments are:

  • hostname
  • username
  • cwd
  • tail

Here is an example with some colors.

PS1='$(corylus \
	"[" hostname "] " \
	"\033[34m" username "\033[0m " \
	"\033[35m" cwd "\033[0m" \
	tail)'

Which outputs with this format:

[myhost] myname ~
$

#Install

go get git.sr.ht/~fmac/corylus

#Contributing

Of course you are free to send me an email with a patch that adds new segments.