mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 03:40:41 +01:00
Add custom segment
This commit is contained in:
@@ -129,6 +129,14 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|
||||
|`BULLETTRAIN_TIME_BG`|`''`|Background color
|
||||
|`BULLETTRAIN_TIME_FG`|`''`|Foreground color
|
||||
|
||||
### Custom
|
||||
|
||||
|Variable|Default|Meaning
|
||||
|--------|-------|-------|
|
||||
|`BULLETTRAIN_CUSTOM_MSG`|`false`|Free segment you can put a custom message
|
||||
|`BULLETTRAIN_CUSTOM_BG`|`black`|Background color
|
||||
|`BULLETTRAIN_CUSTOM_FG`|`black`|Foreground color
|
||||
|
||||
### Context
|
||||
|
||||
|Variable|Default|Meaning
|
||||
|
||||
@@ -57,6 +57,17 @@ if [ ! -n "${BULLETTRAIN_TIME_FG+1}" ]; then
|
||||
BULLETTRAIN_TIME_FG=black
|
||||
fi
|
||||
|
||||
# CUSTOM
|
||||
if [ ! -n "${BULLETTRAIN_CUSTOM_MSG+1}" ]; then
|
||||
BULLETTRAIN_CUSTOM_MSG=false
|
||||
fi
|
||||
if [ ! -n "${BULLETTRAIN_CUSTOM_BG+1}" ]; then
|
||||
BULLETTRAIN_CUSTOM_BG=black
|
||||
fi
|
||||
if [ ! -n "${BULLETTRAIN_CUSTOM_FG+1}" ]; then
|
||||
BULLETTRAIN_CUSTOM_FG=default
|
||||
fi
|
||||
|
||||
# VIRTUALENV
|
||||
if [ ! -n "${BULLETTRAIN_VIRTUALENV_SHOW+1}" ]; then
|
||||
BULLETTRAIN_VIRTUALENV_SHOW=true
|
||||
@@ -286,6 +297,15 @@ prompt_context() {
|
||||
[[ -n "$_context" ]] && prompt_segment $BULLETTRAIN_CONTEXT_BG $BULLETTRAIN_CONTEXT_FG "$_context"
|
||||
}
|
||||
|
||||
# Custom
|
||||
prompt_custom() {
|
||||
if [[ $BULLETTRAIN_CUSTOM_MSG == false ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
prompt_segment $BULLETTRAIN_CUSTOM_BG $BULLETTRAIN_CUSTOM_FG "${BULLETTRAIN_CUSTOM_MSG}"
|
||||
}
|
||||
|
||||
# Git
|
||||
prompt_git() {
|
||||
if [[ $BULLETTRAIN_GIT_SHOW == false ]]; then
|
||||
@@ -508,6 +528,7 @@ build_prompt() {
|
||||
RETVAL=$?
|
||||
prompt_time
|
||||
prompt_status
|
||||
prompt_custom
|
||||
prompt_context
|
||||
prompt_dir
|
||||
prompt_ruby
|
||||
|
||||
Reference in New Issue
Block a user