corylus

command module
v0.0.0-...-2b7b889 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

README

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:

  • cwd
  • cwd-count
  • hostname
  • tail
  • time-unix
  • username

Here is an example with some colors.

PS1='$(corylus \
	"[" hostname "] " \
	"\033[34m" username "\033[0m " \
	"\033[31m $? \033[0m " \
	"\033[35m" cwd "\033[0m " \
	"[" cwd-count " files] " \
	"[" time-unix "]" \
	tail)'

Which outputs with this format:

[maze] fmac  0  ~/r/c/.git [13 files] [1620754137]
$

Install

go install git.sr.ht/~fmac/corylus@latest

Contributing

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL