diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index b0a794f4..0b67e806 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -222,7 +222,25 @@ build_prompt() { prompt_git prompt_bzr prompt_hg + prompt_docker_host +# prompt_k8s_context prompt_end } PROMPT='%{%f%b%k%}$(build_prompt) ' + +prompt_docker_host() { + if [[ ! -z "$DOCKER_MACHINE_NAME" ]]; then + prompt_segment red default "\xF0\x9F\x90\xB3: '$DOCKER_MACHINE_NAME'" + elif [[ ! -z "$DOCKER_HOST" ]]; then + prompt_segment red default "\xF0\x9F\x90\xB3: '$DOCKER_HOST'" + fi +} + +# k8s context +#prompt_k8s_context() { +# K8S_CONTEXT=$(cat $KUBECONFIG | grep 'current-context:' | cut -d: -f2 | tr -d ' ') +# if [[ -n "$K8S_CONTEXT" ]]; then +# prompt_segment red default "%{$fg_bold[blue]%}\xE2\x8E\x88%{$fg_no_bold[white]%}: '$K8S_CONTEXT'" +# fi +#}