Add docker_context segment

Adds docker_context segment to show current docker context, with
SHOW_ON_COMMAND and SHOW_DEFAULT parameters.

Closes #1485
This commit is contained in:
Eli Treuherz 2021-11-17 10:14:00 +00:00
commit 4dea8c7a08
6 changed files with 60 additions and 0 deletions

View file

@ -68,6 +68,7 @@
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/)
docker_context # current docker context (https://docs.docker.com/engine/context/working-with-contexts/)
kubecontext # current kubernetes context (https://kubernetes.io/)
terraform # terraform workspace (https://www.terraform.io)
# terraform_version # terraform version (https://www.terraform.io)
@ -1283,6 +1284,13 @@
################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]#################
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf'
#############[ docker_context: current docker context (https://docs.docker.com/engine/context/working-with-contexts/) ]#############
# Show docker context only when the command you are typing invokes one of these (pipe-separated) tools.
# Comment the next line to always show docker context.
typeset -g POWERLEVEL9K_DOCKER_CONTEXT_SHOW_ON_COMMAND='docker'
# Don't show docker context if it's literally "default".
typeset -g POWERLEVEL9K_DOCKER_CONTEXT_SHOW_DEFAULT=false
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
# Show kubecontext only when the the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show kubecontext.