Add Docker Machine Env Node to Agnoster Theme

This commit is contained in:
adphi 2018-06-07 09:27:44 +02:00
parent 374688b313
commit 2e439a7d4e

View File

@ -222,7 +222,25 @@ build_prompt() {
prompt_git prompt_git
prompt_bzr prompt_bzr
prompt_hg prompt_hg
prompt_docker_host
# prompt_k8s_context
prompt_end prompt_end
} }
PROMPT='%{%f%b%k%}$(build_prompt) ' 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
#}