Add in_toolbox prompt to powerline themes

[Toolbox](https://github.com/containers/toolbox) is an containerized
development environment. This commit adds a promot to powerline when it
is running inside a toolbox.
This commit is contained in:
Kan Li
2020-11-28 12:05:36 -08:00
parent 13deafbb1b
commit 8ce9d8daa5
12 changed files with 41 additions and 5 deletions

View File

@@ -64,5 +64,8 @@ THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:="%H:%M:%S"}
IN_VIM_THEME_PROMPT_COLOR=245
IN_VIM_THEME_PROMPT_TEXT="vim"
IN_TOOLBOX_THEME_PROMPT_COLOR=125
IN_TOOLBOX_THEME_PROMPT_TEXT=" "
safe_append_prompt_command __powerline_prompt_command

View File

@@ -120,13 +120,13 @@ function __powerline_cwd_prompt {
}
function __powerline_hostname_prompt {
local fg_color=206
local fg_color=206
echo "$(hostname -s)|${HOST_THEME_PROMPT_COLOR}|${fg_color}"
echo "$(hostname -s)|${HOST_THEME_PROMPT_COLOR}|${fg_color}"
}
function __powerline_wd_prompt {
local fg_color=206
local fg_color=206
echo "\W|${CWD_THEME_PROMPT_COLOR}|${fg_color}"
}
@@ -158,7 +158,7 @@ function __powerline_battery_prompt {
}
function __powerline_in_vim_prompt {
local fg_color=206
local fg_color=206
if [ -n "$VIMRUNTIME" ]; then
echo "${IN_VIM_THEME_PROMPT_TEXT}|${IN_VIM_THEME_PROMPT_COLOR}|${fg_color}"
@@ -166,13 +166,21 @@ function __powerline_in_vim_prompt {
}
function __powerline_aws_profile_prompt {
local fg_color=206
local fg_color=206
if [[ -n "${AWS_PROFILE}" ]]; then
echo "${AWS_PROFILE_CHAR}${AWS_PROFILE}|${AWS_PROFILE_PROMPT_COLOR}|${fg_color}"
fi
}
function __powerline_in_toolbox_prompt {
local fg_color=206
if [[ -e /run/.toolboxenv ]]; then
echo "${IN_TOOLBOX_THEME_PROMPT_TEXT}|${IN_TOOLBOX_THEME_PROMPT_COLOR}|${fg_color}"
fi
}
function __powerline_left_segment {
local OLD_IFS="${IFS}"; IFS="|"
local params=( $1 )