Skip to content

Minimalistic command prompt for fish, written in Rust.

License

Notifications You must be signed in to change notification settings

Gregory-Meyer/clanker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clanker

Crates.io

Clanker is a theme for fish with a focus on minimalism.

clanker demo

Installation

cargo install clanker

Then place this in your config.fish or somewhere that will be sourced when fish starts up:

function fish_prompt
    set -g CLANKER_STATUS $status
    clanker-prompt
end

function fish_right_prompt
    clanker-right-prompt "$CLANKER_STATUS"
end

function fish_title
    clanker-title "$_"
end

Building From Source

git clone [email protected]:Gregory-Meyer/clanker.git
cd clanker
cargo build --release

You will then need to copy the binaries from target/release to somewhere in your PATH, like /usr/local/bin.

Usage

clanker-prompt

clanker-prompt outputs the current username, hostname, and compressed current working directory. There are two optional arguments -- the unpriviliged and priviliged line enders. These default to '>' and '#', respectively, but you may replace them at runtime using these arguments.

clanker-right-prompt

clanker-right-prompt prints the status of the last command in red if it was nonzero and some info the git repository the current folder is in. If the current directory is a git repository according to git_repository_open_ext(..., REPOSITORY_OPEN_FROM_ENV, ...), this program will print out some info about HEAD. If HEAD points to a branch, the name of that branch will be printed. If HEAD points to a tagged commit, the name of those tags will be printed. If multiple tags point to the same commit as HEAD, then the tags are delimited with a backslash ('\'). Otherwise, the shortened 7-digit SHA sum of the current commit will be output.

clanker-title

clanker-title optionally takes the currently running program as an argument and prints it along with the compressed current working directory.

Path Compression

Paths are compressed so that each compressed component is the shortest unique prefix of a filename in that path. A component will never be shortened to "." or "..". The last component in a path is never shortened. Components that do not represent a unique prefix at all are not compressed. Home directories of another user, like ~gregjm or ~root, are not compressed.

About

Minimalistic command prompt for fish, written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages