Sure, your shell is bourne again... but is it baptized?
baptize is a small bash framework for making sweet prompts that Jesus would be proud of. Baptize aims to be a shareable, and configurable way to manage common terminal environment customizations. Baptize is written purely in bash, which makes it quick and portable.
Note: You'll need a powerline patched font. Once the font is installed, set your terminal to use that font.
git clone [email protected]:daytonn/baptize.git ~/.baptize
Then in your .bashrc
or .bash_profile
paste this:
source ~/.baptize/lib/baptize.sh
Baptize comes preconfigured with some color settings but to customize the settings you'll need a ~/.holywater
configuration file.
Create a configuration file with the config
command:
baptize config init
This will create a ~/.holywater
file with all the customizeable variables with their default values. To reload baptize with this configuration type:
baptize repent
There are several variables that control your customized prompt. Simply set them in your ~/.holywater
file and then baptize repent
and you will see your changes. Color variables can use any of the available colors
This sets the icon at the beginning of your prompt. This is just for style to add a bit of personality. You can use emoji or unicode characters or anything you like. If you prefer not to have an icon, simply set BAPTIZE_PROMPT_ICON
to an empty string BAPTIZE_PROMPT_ICON=""
.
This sets the content of your prompt. You can use any of the prompt statment variables. The baptize default is simply the working directory \w
variable.
This is the text color of your prompt.
This sets the color of the BAPTIZE_PROMPT_ICON
. Set this to any of the available baptize colors. To see a list of available colors use baptize colors
.
This sets the color of the continuation interactive prompt. Set this to any of the available baptize colors. To see a list of available colors use baptize colors
.
This turns on those cool pointy separators that powerline uses.
Baptize will change your prompt when the current directory is within a git repository. There are a few variables that let you customize the look of the prompt when in "git mode".
This variable determines whether or not the status "stats" will be shown in your prompt. By default baptize is set to show the stats of the current git status BAPTIZE_GIT_SHOW_STATS="yes"
. Meaning the modified file count, the added file count, and the deleted file count. This shows up in your prompt like so: 1:2:3
. This example would mean you have 1 modified file, 2 added files, and 3 deleted files. To turn off the stats count, simply set this variable to no: BAPTIZE_GIT_SHOW_STATS="no"
.
This variable sets the character that separates the stat count numbers.
This variable determines whether or not to show the entire working path, or just the path from the root of the project. By default bpatize is set to only show the path from the project root BAPTIZE_GIT_SHORT_PATH="yes"
. This means that a project in /Users/username/development/work/myproject
would only show myproject
as the working directory. If you cd to a directory inside the project, that will be reflected in the prompt: myproject/nested/directory
. To turn off the short path, simply set this variable to no: BAPTIZE_GIT_SHORT_PATH="no"
.
This variable sets the icon that will display when your local branch is behind the remote branch. By default this icon is set to: BAPTIZE_GIT_PULL_ICON=" ⇣ "
. If you prefer not to see this icon, simply set this variable to an empty string: BAPTIZE_GIT_PULL_ICON=""
.
This variable sets the icon that will display when your local branch has changes to be push up to the remote. By default this icon is set to: BAPTIZE_GIT_PUSH_ICON=" ⇡ "
. If you prefer not to see this icon, simply set this variable to an empty string: BAPTIZE_GIT_PUSH_ICON=""
.
This variable sets the icon that will display when your local branch is clean. By default this icon is set to: BAPTIZE_GIT_CLEAN_ICON=" ✓ "
. If you prefer not to see this icon, simply set this variable to an empty string: BAPTIZE_GIT_CLEAN_ICON=""
.
This sets the foreground color of the git prompt when the local branch is clean.
This sets the background color of the git prompt when the local branch is clean.
This sets the foreground color of the git prompt when the local branch has changes and the color of the modified file count in the git stats.
This sets the background color of the git prompt when the local branch has changes and the color of the modified file count in the git stats.
This sets the foreground color of the added file count in the git stats.
This sets the background color of the added file count in the git stats.
This sets the foreground color of the deleted file count in the git stats.
This sets the background color of the deleted file count in the git stats.
Baptize comes with a full suite of color variables necessary to create any color your terminal can produce. Note: your terminal color theme may change the actual color these values produce. This works great with iTerm2 and these custom themes
black
white
red
green
blue
yellow
cyan
magenta
To view all the available color variables, and what they look like use the colors
command:
baptize colors
Plugins are simply bash scripts placed in folders inside the plugins
directory. Baptize will load all plugins by sourcing the .sh
file with the name of it's plugin. For example, the barista plugin is located at plugins/barista/barista.sh
and will automatically be sourced by baptize.
List of Baptize plugins: