Skip to content

Soft/mkprompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mkprompt 🧋

mkprompt is a tool for creating fancy shell prompts. Prompts are configured in a small functional language embedded in JSON.

Installation

Building requires Go and asciidoctor for the man page.

make
sudo make install DESTDIR=/usr/local

Shell Integration

Source the supplied script from ~/.bashrc:

source /usr/local/share/mkprompt/shell/mkprompt.bash

Configuration

The configuration file lives at ~/.config/mkprompt/mkprompt.json. A default is created on first run. Here is a minimal example that renders user@host:path$ :

{
  "call": "sequence",
  "elements": [
    { "call": "text", "content": { "call": "username" } },
    { "call": "text", "content": "@" },
    { "call": "text", "content": { "call": "hostname" } },
    { "call": "text", "content": ":" },
    { "call": "text", "content": { "call": "abbreviate_path", "path": { "call": "current_directory" } } },
    { "call": "text", "content": "$ " }
  ]
}

See man mkprompt for the full language reference and mkprompt --list-builtins for a listing of all available built-in functions. Ready-to-use examples are in the examples/ directory.

License

MIT. See LICENSE.

About

Fancy programmable shell prompts 🧋

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages