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_BG`|`''`|Background color
|
||||||
|`BULLETTRAIN_TIME_FG`|`''`|Foreground 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
|
### Context
|
||||||
|
|
||||||
|Variable|Default|Meaning
|
|Variable|Default|Meaning
|
||||||
|
|||||||
@@ -57,6 +57,17 @@ if [ ! -n "${BULLETTRAIN_TIME_FG+1}" ]; then
|
|||||||
BULLETTRAIN_TIME_FG=black
|
BULLETTRAIN_TIME_FG=black
|
||||||
fi
|
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
|
# VIRTUALENV
|
||||||
if [ ! -n "${BULLETTRAIN_VIRTUALENV_SHOW+1}" ]; then
|
if [ ! -n "${BULLETTRAIN_VIRTUALENV_SHOW+1}" ]; then
|
||||||
BULLETTRAIN_VIRTUALENV_SHOW=true
|
BULLETTRAIN_VIRTUALENV_SHOW=true
|
||||||
@@ -286,6 +297,15 @@ prompt_context() {
|
|||||||
[[ -n "$_context" ]] && prompt_segment $BULLETTRAIN_CONTEXT_BG $BULLETTRAIN_CONTEXT_FG "$_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
|
# Git
|
||||||
prompt_git() {
|
prompt_git() {
|
||||||
if [[ $BULLETTRAIN_GIT_SHOW == false ]]; then
|
if [[ $BULLETTRAIN_GIT_SHOW == false ]]; then
|
||||||
@@ -508,6 +528,7 @@ build_prompt() {
|
|||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_time
|
prompt_time
|
||||||
prompt_status
|
prompt_status
|
||||||
|
prompt_custom
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_dir
|
prompt_dir
|
||||||
prompt_ruby
|
prompt_ruby
|
||||||
|
|||||||
Reference in New Issue
Block a user