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:
@@ -58,6 +58,7 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o
|
||||
* `clock` - Current time in `HH:MM:SS` format
|
||||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||
* `hostname` - Host name of machine
|
||||
* `in_toolbox` - Show identifier if running inside a toolbox
|
||||
* `in_vim` - Show identifier if running in `:terminal` from vim
|
||||
* `k8s_context` - Show current kubernetes context
|
||||
* `last_status` - Exit status of last run command
|
||||
|
||||
@@ -169,6 +169,12 @@ function __powerline_aws_profile_prompt() {
|
||||
fi
|
||||
}
|
||||
|
||||
function __powerline_in_toolbox_prompt() {
|
||||
if [[ -e /run/.toolboxenv ]]; then
|
||||
echo "${IN_TOOLBOX_THEME_PROMPT_TEXT}|${IN_TOOLBOX_THEME_PROMPT_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
function __powerline_shlvl_prompt() {
|
||||
if [[ "${SHLVL}" -gt 1 ]]; then
|
||||
local prompt="${SHLVL_THEME_PROMPT_CHAR}"
|
||||
|
||||
@@ -71,6 +71,9 @@ THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:="%H:%M:%S"}
|
||||
IN_VIM_THEME_PROMPT_COLOR=${POWERLINE_IN_VIM_COLOR:=245}
|
||||
IN_VIM_THEME_PROMPT_TEXT=${POWERLINE_IN_VIM_TEXT:="vim"}
|
||||
|
||||
IN_TOOLBOX_THEME_PROMPT_COLOR=${POWERLINE_IN_TOOLBOX_COLOR:=125}
|
||||
IN_TOOLBOX_THEME_PROMPT_TEXT=${POWERLINE_IN_TOOLBOX_TEXT:="❲T❳ "}
|
||||
|
||||
HOST_THEME_PROMPT_COLOR=${POWERLINE_HOST_COLOR:=0}
|
||||
|
||||
SHLVL_THEME_PROMPT_COLOR=${POWERLINE_SHLVL_COLOR:=${HOST_THEME_PROMPT_COLOR}}
|
||||
|
||||
Reference in New Issue
Block a user