Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add terraform workspace prompt segment #271

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions functions/__bobthefish_colors.fish
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual bryellow $colorfg --bold

set -x color_vagrant brcyan $colorfg
set -x color_tf brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
Expand Down Expand Up @@ -62,6 +63,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual bryellow $colorfg --bold

set -x color_vagrant brcyan $colorfg
set -x color_tf brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
Expand Down Expand Up @@ -97,6 +99,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual bryellow $colorfg --bold

set -x color_vagrant brcyan $colorfg
set -x color_tf brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
Expand Down Expand Up @@ -132,6 +135,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual bryellow $colorfg --bold

set -x color_vagrant brcyan $colorfg
set -x color_tf brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
Expand Down Expand Up @@ -173,6 +177,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $yellow $grey --bold

set -x color_vagrant $blue $green --bold
set -x color_tf $blue $green --bold
set -x color_k8s $green $white --bold
set -x color_aws_vault $blue $grey --bold
set -x color_aws_vault_expired $blue $red --bold
Expand Down Expand Up @@ -225,6 +230,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $base09 $colorfg --bold

set -x color_vagrant $base0C $colorfg --bold
set -x color_tf $base0C $colorfg --bold
set -x color_k8s $base06 $colorfg --bold
set -x color_aws_vault $base0D $colorfg --bold
set -x color_aws_vault_expired $base0D $base08 --bold
Expand Down Expand Up @@ -277,6 +283,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $base09 $colorfg --bold

set -x color_vagrant $base0C $colorfg --bold
set -x color_tf $base0C $colorfg --bold
set -x color_k8s $base0B $colorfg --bold
set -x color_aws_vault $base0D $base0A --bold
set -x color_aws_vault_expired $base0D $base08 --bold
Expand Down Expand Up @@ -329,6 +336,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $yellow $colorfg --bold

set -x color_vagrant $violet $colorfg --bold
set -x color_tf $violet $colorfg --bold
set -x color_k8s $green $colorfg --bold
set -x color_aws_vault $violet $base3 --bold
set -x color_aws_vault_expired $violet $orange --bold
Expand Down Expand Up @@ -381,6 +389,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $yellow $colorfg --bold

set -x color_vagrant $violet $colorfg --bold
set -x color_tf $violet $colorfg --bold
set -x color_k8s $green $colorfg --bold
set -x color_aws_vault $violet $base3 --bold
set -x color_aws_vault_expired $violet $orange --bold
Expand Down Expand Up @@ -426,6 +435,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $orange[1] $orange[3] --bold

set -x color_vagrant $blue[1] $white --bold
set -x color_tf $blue[1] $white --bold
set -x color_k8s $green[1] $colorfg --bold
set -x color_aws_vault $blue[3] $orange[1] --bold
set -x color_aws_vault_expired $blue[3] $red[3] --bold
Expand Down Expand Up @@ -470,6 +480,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $yellow[1] $bg[2] --bold

set -x color_vagrant $blue[2] $fg[2] --bold
set -x color_tf $blue[2] $fg[2] --bold
set -x color_k8s $green[2] $fg[2] --bold
set -x color_aws_vault $blue[2] $yellow[1] --bold
set -x color_aws_vault_expired $blue[2] $red[1] --bold
Expand Down Expand Up @@ -516,6 +527,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $orange $bg --bold

set -x color_vagrant $pink $bg --bold
set -x color_tf $pink $bg --bold
set -x color_k8s $green $fg --bold
set -x color_aws_vault $comment $yellow --bold
set -x color_aws_vault_expired $comment $red --bold
Expand Down Expand Up @@ -568,6 +580,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $base07 $colorfg --bold

set -x color_vagrant $base02 $colorfg --bold
set -x color_tf $base02 $colorfg --bold
set -x color_k8s $base02 $colorfg --bold
set -x color_aws_vault $base0A $base0D --bold
set -x color_aws_vault_expired $base0A $base0B --bold
Expand Down Expand Up @@ -613,6 +626,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_visual $orange[1] $orange[3] --bold

set -x color_vagrant $blue[1] $white --bold
set -x color_tf $blue[1] $white --bold
set -x color_k8s $green[2] $white --bold
set -x color_aws_vault $blue[3] $orange[1] --bold
set -x color_aws_vault_expired $blue[3] $red[3] --bold
Expand Down Expand Up @@ -644,6 +658,7 @@ function __bobthefish_user_color_scheme_deprecated
set -q __color_vi_mode_insert; or set -l __color_vi_mode_insert 189303 333333 --bold
set -q __color_vi_mode_visual; or set -l __color_vi_mode_visual f6b117 3a2a03 --bold
set -q __color_vagrant; or set -l __color_vagrant 48b4fb ffffff --bold
set -q __color_tf; or set -l __color_tf 48b4fb ffffff --bold
set -q __color_username; or set -l __color_username cccccc 255e87 --bold
set -q __color_hostname; or set -l __color_hostname cccccc 255e87
set -q __color_rvm; or set -l __color_rvm af0000 cccccc --bold
Expand Down
3 changes: 3 additions & 0 deletions functions/__bobthefish_glyphs.fish
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Kubernetes glyphs
set -x k8s_glyph \u2388 # '⎈'

# Terraform glyph
set -x tf_glyph \ufcfc # 'ﳼ'

# Vagrant glyphs
set -x vagrant_running_glyph \u2191 # ↑ 'running'
set -x vagrant_poweroff_glyph \u2193 # ↓ 'poweroff'
Expand Down
14 changes: 14 additions & 0 deletions functions/fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# set -g theme_display_git_default_branch yes
# set -g theme_git_default_branches main trunk
# set -g theme_git_worktree_support yes
# set -g theme_display_tf_workspace yes
# set -g theme_display_vagrant yes
# set -g theme_display_docker_machine no
# set -g theme_display_k8s_context yes
Expand Down Expand Up @@ -599,6 +600,18 @@ function __bobthefish_prompt_docker -S -d 'Display Docker machine name'
echo -ns $DOCKER_MACHINE_NAME ' '
end

function __bobthefish_prompt_tf_workspace -S -d 'Display current terraform workspace environment'
[ "$theme_display_tf_workspace" = 'yes' ]
or return

set -l tf_workspace (terraform workspace show)

__bobthefish_start_segment $color_tf
echo -ns $tf_glyph ' ' $tf_workspace ' '

set_color normal
end

function __bobthefish_k8s_context -S -d 'Get the current k8s context'
set -l config_paths "$HOME/.kube/config"
[ -n "$KUBECONFIG" ]
Expand Down Expand Up @@ -1129,6 +1142,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'

# Containers and VMs
__bobthefish_prompt_vagrant
__bobthefish_prompt_tf_workspace
__bobthefish_prompt_docker
__bobthefish_prompt_k8s_context

Expand Down