Add podman segment displaying remote connection

Optionally expose the CONTAINER_CONNECTION variable in a segment.
pull/364/head
Cédric Bosdonnat 3 weeks ago
parent 4f0b0a5638
commit 7d818f4c48
No known key found for this signature in database
GPG Key ID: 3080163FB51ADE1A

@ -196,6 +196,10 @@ This feature is disabled by default. Use `yes` to show the current Kubernetes co
This feature is disabled by default. Use `yes` to show the current Kubernetes namespace.
#### `set -g theme_display_podman yes`
This feature is disabled by default. Use `yes` to show the current podman remote connection name.
#### `set -g theme_display_aws_vault_profile yes`
This feature is disabled by default. Use `yes` to show the currently executing [AWS Vault](https://github.com/99designs/aws-vault) profile.

@ -28,6 +28,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_podman magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
set -x color_username white black --bold
@ -64,6 +65,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_podman magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
set -x color_username black white --bold
@ -100,6 +102,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_podman magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
set -x color_username brgrey white --bold
@ -136,6 +139,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold
set -x color_podman magenta white --bold
set -x color_aws_vault blue $colorfg --bold
set -x color_aws_vault_expired blue red --bold
set -x color_username grey black --bold
@ -178,6 +182,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $blue $green --bold
set -x color_k8s $green $white --bold
set -x color_podman $blue $white --bold
set -x color_aws_vault $blue $grey --bold
set -x color_aws_vault_expired $blue $red --bold
set -x color_username $grey $blue --bold
@ -231,6 +236,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $base0C $colorfg --bold
set -x color_k8s $base06 $colorfg --bold
set -x color_podman $base0E $colorfg --bold
set -x color_aws_vault $base0D $colorfg --bold
set -x color_aws_vault_expired $base0D $base08 --bold
set -x color_username $base02 $base0D --bold
@ -284,6 +290,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $base0C $colorfg --bold
set -x color_k8s $base0B $colorfg --bold
set -x color_podman $base0E $colorfg --bold
set -x color_aws_vault $base0D $base0A --bold
set -x color_aws_vault_expired $base0D $base08 --bold
set -x color_username $base02 $base0D --bold
@ -337,6 +344,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $violet $colorfg --bold
set -x color_k8s $green $colorfg --bold
set -x color_podman $violet $colorfg --bold
set -x color_aws_vault $violet $base3 --bold
set -x color_aws_vault_expired $violet $orange --bold
set -x color_username $base2 $blue --bold
@ -390,6 +398,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $violet $colorfg --bold
set -x color_k8s $green $colorfg --bold
set -x color_podman $violet $colorfg --bold
set -x color_aws_vault $violet $base3 --bold
set -x color_aws_vault_expired $violet $orange --bold
set -x color_username $base02 $blue --bold
@ -436,6 +445,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $blue[1] $white --bold
set -x color_k8s $green[1] $colorfg --bold
set -x color_podman $blue[1] $white --bold
set -x color_aws_vault $blue[3] $orange[1] --bold
set -x color_aws_vault_expired $blue[3] $red[3] --bold
set -x color_username $grey[1] $blue[3] --bold
@ -481,6 +491,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $blue[2] $fg[2] --bold
set -x color_k8s $green[2] $fg[2] --bold
set -x color_podman $blue[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
set -x color_username $fg[3] $blue[2] --bold
@ -571,6 +582,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $pink $bg --bold
set -x color_k8s $purple $bg --bold
set -x color_podman $purple $bg --bold
set -x color_aws_vault $comment $yellow --bold
set -x color_aws_vault_expired $comment $red --bold
set -x color_username $selection $cyan --bold
@ -624,6 +636,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $base02 $colorfg --bold
set -x color_k8s $base02 $colorfg --bold
set -x color_podman $base0E $colorfg --bold
set -x color_aws_vault $base0A $base0D --bold
set -x color_aws_vault_expired $base0A $base0B --bold
set -x color_username $base02 $base0D --bold
@ -1018,6 +1031,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vagrant $blue[1] $white --bold
set -x color_k8s $green[2] $white --bold
set -x color_podman $blue[1] $white --bold
set -x color_aws_vault $blue[3] $orange[1] --bold
set -x color_aws_vault_expired $blue[3] $red[3] --bold
set -x color_username $grey[1] $blue[3] --bold

@ -30,6 +30,9 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Kubernetes glyphs
set -x k8s_glyph \u2388 # '⎈'
# Podman glyphs
set -x podman_glyph \uf4b7
# Vagrant glyphs
set -x vagrant_running_glyph \u2191 # ↑ 'running'
set -x vagrant_poweroff_glyph \u2193 # ↓ 'poweroff'

@ -166,5 +166,9 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo
echo -ns $k8s_glyph ' k8s-context'
__bobthefish_finish_segments
__bobthefish_start_segment $color_podman
echo -ns $podman_glyph ' podman'
__bobthefish_finish_segments
echo -e "\n"
end

@ -646,6 +646,16 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context'
echo -ns $segment ' '
end
function __bobthefish_prompt_podman -S -d 'Show current podman connection'
[ "$theme_display_podman" = 'yes' ]
or return
[ -z "$CONTAINER_CONNECTION" ]
and return
__bobthefish_start_segment $color_podman
echo -ns $podman_glyph ' ' $CONTAINER_CONNECTION ' '
end
# ==============================
# Cloud Tools
@ -1294,6 +1304,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
__bobthefish_prompt_vagrant
__bobthefish_prompt_docker
__bobthefish_prompt_k8s_context
__bobthefish_prompt_podman
# Cloud Tools
__bobthefish_prompt_aws_vault_profile

Loading…
Cancel
Save