Add kubernetes-context segment to powerline
parent
a8ee759293
commit
7e26ae28bf
|
|
@ -336,6 +336,10 @@ function ruby_version_prompt {
|
|||
echo -e "$(rbfu_version_prompt)$(rbenv_version_prompt)$(rvm_version_prompt)$(chruby_version_prompt)"
|
||||
}
|
||||
|
||||
function k8s_context_prompt {
|
||||
echo -e "$(kubectl config current-context)"
|
||||
}
|
||||
|
||||
function virtualenv_prompt {
|
||||
if [[ -n "$VIRTUAL_ENV" ]]; then
|
||||
virtualenv=`basename "$VIRTUAL_ENV"`
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ A colorful theme, where shows a lot information about your shell session.
|
|||
* An indicator when the current shell is inside the Vim editor
|
||||
* Battery charging status (depends on the [../../plugins/available/battery.plugin.bash](battery plugin))
|
||||
* SCM Repository status (e.g. Git, SVN)
|
||||
* The current Kubernetes environment
|
||||
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
|
||||
* The current Ruby environment (rvm and rbenv are supported) in use
|
||||
* Last command exit code (only shown when the exit code is greater than 0)
|
||||
|
|
@ -48,6 +49,7 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o
|
|||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||
* `hostname` - Host name of machine
|
||||
* `in_vim` - Show identifier if running in `:terminal` from vim
|
||||
* `k8s_context` - Show current kubernetes context
|
||||
* `last_status` - Exit status of last run command
|
||||
* `python_venv` - Python virtual environment information (`virtualenv`, `venv`
|
||||
and `conda` supported)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ RBENV_THEME_PROMPT_SUFFIX=""
|
|||
RUBY_THEME_PROMPT_COLOR=161
|
||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
||||
|
||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=26
|
||||
|
||||
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||
AWS_PROFILE_PROMPT_COLOR=208
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ A colorful theme, where shows a lot information about your shell session.
|
|||
* An indicator when the current shell is inside the Vim editor
|
||||
* Battery charging status (depends on the [../../plugins/available/battery.plugin.bash](battery plugin))
|
||||
* SCM Repository status (e.g. Git, SVN)
|
||||
* The current Kubernetes environment
|
||||
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
|
||||
* The current Ruby environment (rvm and rbenv are supported) in use
|
||||
* Last command exit code (only shown when the exit code is greater than 0)
|
||||
|
|
@ -46,6 +47,7 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o
|
|||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||
* `hostname` - Host name of machine
|
||||
* `in_vim` - Show identifier if running in `:terminal` from vim
|
||||
* `k8s_context` - Show current kubernetes context
|
||||
* `last_status` - Exit status of last run command
|
||||
* `python_venv` - Python virtual environment information (`virtualenv`, `venv`
|
||||
and `conda` supported)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ RBENV_THEME_PROMPT_SUFFIX=""
|
|||
RUBY_THEME_PROMPT_COLOR=161
|
||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="💎 "}
|
||||
|
||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=26
|
||||
|
||||
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||
AWS_PROFILE_PROMPT_COLOR=208
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ A colorful theme, where shows a lot information about your shell session.
|
|||
* An indicator when the current shell is inside the Vim editor
|
||||
* Battery charging status (depends on the [../../plugins/available/battery.plugin.bash](battery plugin))
|
||||
* SCM Repository status (e.g. Git, SVN)
|
||||
* The current Kubernetes environment
|
||||
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
|
||||
* The current Ruby environment (rvm and rbenv are supported) in use
|
||||
* Last command exit code (only shown when the exit code is greater than 0)
|
||||
|
|
@ -50,6 +51,7 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o
|
|||
* `cwd` - Current working directory including full folder hierarchy (c.f. `wd`)
|
||||
* `hostname` - Host name of machine
|
||||
* `in_vim` - Show identifier if running in `:terminal` from vim
|
||||
* `k8s_context` - Show current kubernetes context
|
||||
* `last_status` - Exit status of last run command
|
||||
* `python_venv` - Python virtual environment information (`virtualenv`, `venv`
|
||||
and `conda` supported)
|
||||
|
|
|
|||
|
|
@ -52,6 +52,16 @@ function __powerline_ruby_prompt {
|
|||
[[ -n "${ruby_version}" ]] && echo "${RUBY_CHAR}${ruby_version}|${RUBY_THEME_PROMPT_COLOR}"
|
||||
}
|
||||
|
||||
function __powerline_k8s_context_prompt {
|
||||
local kubernetes_context=""
|
||||
|
||||
if _command_exists kubectl; then
|
||||
kubernetes_context="$(k8s_context_prompt)"
|
||||
fi
|
||||
|
||||
[[ -n "${kubernetes_context}" ]] && echo "${KUBERNETES_CONTEXT_THEME_CHAR}${kubernetes_context}|${KUBERNETES_CONTEXT_THEME_PROMPT_COLOR}"
|
||||
}
|
||||
|
||||
function __powerline_python_venv_prompt {
|
||||
set +u
|
||||
local python_venv=""
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ RBENV_THEME_PROMPT_SUFFIX=""
|
|||
RUBY_THEME_PROMPT_COLOR=161
|
||||
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "}
|
||||
|
||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=26
|
||||
|
||||
AWS_PROFILE_CHAR="${POWERLINE_AWS_PROFILE_CHAR:=❲aws❳ }"
|
||||
AWS_PROFILE_PROMPT_COLOR=208
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue