From 9c6020543fdfe3cf9de4f5913eb9ac72aa6af916 Mon Sep 17 00:00:00 2001 From: Tanner Bruce Date: Tue, 17 Oct 2017 13:31:15 -0500 Subject: [PATCH] show kubernetes context --- README.md | 1 + fish_prompt.fish | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index a28e0cd..f330b75 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ set -g theme_display_git_ahead_verbose yes set -g theme_git_worktree_support yes set -g theme_display_vagrant yes set -g theme_display_docker_machine no +set -g theme_display_kubernetes no set -g theme_display_hg yes set -g theme_display_virtualenv no set -g theme_display_ruby no diff --git a/fish_prompt.fish b/fish_prompt.fish index 8a9e1f2..72e4345 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -384,6 +384,12 @@ function __bobthefish_prompt_docker -S -d 'Show docker machine name' echo -ns $DOCKER_MACHINE_NAME ' ' end +function __bobthefish_prompt_kubernetes -S -d 'Show the current kubernetes context' + [ "$theme_display_kubernetes" = 'no' -o -z (command -s kubectl) ]; and return + __bobthefish_start_segment $__color_vagrant + echo -ns (kubectl config current-context) ' ' +end + function __bobthefish_prompt_status -S -a last_status -d 'Display symbols for a non zero exit status, root and background jobs' set -l nonzero set -l superuser @@ -1372,6 +1378,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_vi __bobthefish_prompt_vagrant __bobthefish_prompt_docker + __bobthefish_prompt_kubernetes __bobthefish_prompt_user __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish