diff --git a/fish_prompt.fish b/fish_prompt.fish index 6d81185..89136d6 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -23,6 +23,7 @@ # set -g theme_git_worktree_support yes # set -g theme_display_vagrant yes # set -g theme_display_docker_machine no +# set -g theme_display_k8s_context no # set -g theme_display_hg yes # set -g theme_display_virtualenv no # set -g theme_display_ruby no @@ -406,6 +407,12 @@ function __bobthefish_prompt_docker -S -d 'Show docker machine name' echo -ns $DOCKER_MACHINE_NAME ' ' end +function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context' + [ "$theme_display_k8s_context" = 'no' -o ! -f ~/.kube/config ]; and return + __bobthefish_start_segment $__color_k8s + echo -ns (grep current-context ~/.kube/config | awk '{print $2}') ' ' +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 @@ -991,6 +998,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual bryellow $colorfg --bold set __color_vagrant brcyan $colorfg + set __color_k8s magenta white --bold set __color_username white black set __color_rvm brmagenta $colorfg --bold set __color_virtualfish brblue $colorfg --bold @@ -1017,6 +1025,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual bryellow $colorfg --bold set __color_vagrant brcyan $colorfg + set __color_k8s magenta white --bold set __color_username black white set __color_rvm brmagenta $colorfg --bold set __color_virtualfish brblue $colorfg --bold @@ -1043,6 +1052,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual bryellow $colorfg --bold set __color_vagrant brcyan $colorfg + set __color_k8s magenta white --bold set __color_username brgrey white set __color_rvm brmagenta $colorfg --bold set __color_virtualfish brblue $colorfg --bold @@ -1069,6 +1079,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual bryellow $colorfg --bold set __color_vagrant brcyan $colorfg + set __color_k8s magenta white --bold set __color_username grey black set __color_rvm brmagenta $colorfg --bold set __color_virtualfish brblue $colorfg --bold @@ -1101,6 +1112,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $yellow $grey --bold set __color_vagrant $blue $green --bold + set __color_k8s $green $white --bold set __color_username $grey $blue set __color_rvm $red $grey --bold set __color_virtualfish $blue $grey --bold @@ -1144,6 +1156,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $base09 $colorfg --bold set __color_vagrant $base0C $colorfg --bold + set __color_k8s $base06 $colorfg --bold set __color_username $base02 $base0D set __color_rvm $base08 $colorfg --bold set __color_virtualfish $base0D $colorfg --bold @@ -1187,6 +1200,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $base09 $colorfg --bold set __color_vagrant $base0C $colorfg --bold + set __color_k8s $base0B $colorfg --bold set __color_username $base02 $base0D set __color_rvm $base08 $colorfg --bold set __color_virtualfish $base0D $colorfg --bold @@ -1230,6 +1244,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $yellow $colorfg --bold set __color_vagrant $violet $colorfg --bold + set __color_k8s $green $colorfg --bold set __color_username $base2 $blue set __color_rvm $red $colorfg --bold set __color_virtualfish $cyan $colorfg --bold @@ -1273,6 +1288,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $yellow $colorfg --bold set __color_vagrant $violet $colorfg --bold + set __color_k8s $green $colorfg --bold set __color_username $base02 $blue set __color_rvm $red $colorfg --bold set __color_virtualfish $cyan $colorfg --bold @@ -1309,6 +1325,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $orange[1] $orange[3] --bold set __color_vagrant $blue[1] $white --bold + set __color_k8s $green[1] $colorfg --bold set __color_username $grey[1] $blue[3] set __color_rvm $ruby_red $grey[1] --bold set __color_virtualfish $blue[2] $grey[1] --bold @@ -1344,6 +1361,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set -g __color_vi_mode_visual $yellow[1] $bg[2] --bold set -g __color_vagrant $blue[2] $fg[2] --bold + set -g __color_k8s $green[2] $fg[2] --bold set -g __color_username $fg[3] $blue[2] set -g __color_rvm $red[2] $fg[2] --bold set -g __color_virtualfish $blue[2] $fg[2] --bold @@ -1380,6 +1398,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set __color_vi_mode_visual $orange[1] $orange[3] --bold set __color_vagrant $blue[1] $white --bold + set __color_k8s $green[2] $white --bold set __color_username $grey[1] $blue[3] set __color_rvm $ruby_red $grey[1] --bold set __color_virtualfish $blue[2] $grey[1] --bold @@ -1394,6 +1413,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_vi __bobthefish_prompt_vagrant __bobthefish_prompt_docker + __bobthefish_prompt_k8s_context __bobthefish_prompt_user __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish