add function show aws id (#1)

This commit is contained in:
leyla 2020-01-28 16:35:05 +09:00 committed by GitHub
parent 5ed60e09ae
commit 3a743797cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 0 deletions

View File

@ -25,6 +25,7 @@
# set -g theme_display_git_stashed_verbose yes # set -g theme_display_git_stashed_verbose yes
# set -g theme_display_git_master_branch yes # set -g theme_display_git_master_branch yes
# set -g theme_git_worktree_support yes # set -g theme_git_worktree_support yes
# set -g theme_display_aws_account_id no
# set -g theme_display_vagrant yes # set -g theme_display_vagrant yes
# set -g theme_display_docker_machine no # set -g theme_display_docker_machine no
# set -g theme_display_k8s_context yes # set -g theme_display_k8s_context yes
@ -503,6 +504,18 @@ function __bobthefish_prompt_vi -S -d 'Display vi mode'
end end
end end
# ==============================
# Cloud segments
# ==============================
function __bobthefish_prompt_aws_account_id -S -d 'Display AWS AccountId'
function get-account-auto -S --on-variable AWS_ACCESS_KEY_ID
set -x AWS_ACCOUNT_ID (aws sts get-caller-identity --output text --query "Account")
end
[ "$theme_display_aws_account_id" = 'yes' -a -n "$AWS_ACCOUNT_ID" ]; or return
__bobthefish_start_segment $color_aws_id
echo -ns $AWS_ACCOUNT_ID ' '
end
# ============================== # ==============================
# Container and VM segments # Container and VM segments
@ -1067,6 +1080,9 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
# User / hostname info # User / hostname info
__bobthefish_prompt_user __bobthefish_prompt_user
# Cloud
__bobthefish_prompt_aws_account_id
# Containers and VMs # Containers and VMs
__bobthefish_prompt_vagrant __bobthefish_prompt_vagrant
__bobthefish_prompt_docker __bobthefish_prompt_docker

View File

@ -25,6 +25,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert brgreen $colorfg --bold set -x color_vi_mode_insert brgreen $colorfg --bold
set -x color_vi_mode_visual bryellow $colorfg --bold set -x color_vi_mode_visual bryellow $colorfg --bold
set -x color_aws_id yellow $colorfg
set -x color_vagrant brcyan $colorfg set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold set -x color_k8s magenta white --bold
set -x color_username white black --bold set -x color_username white black --bold
@ -87,6 +89,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert brgreen $colorfg --bold set -x color_vi_mode_insert brgreen $colorfg --bold
set -x color_vi_mode_visual bryellow $colorfg --bold set -x color_vi_mode_visual bryellow $colorfg --bold
set -x color_aws_id yellow $colorfg
set -x color_vagrant brcyan $colorfg set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold set -x color_k8s magenta white --bold
set -x color_username brgrey white --bold set -x color_username brgrey white --bold
@ -118,6 +122,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert brgreen $colorfg --bold set -x color_vi_mode_insert brgreen $colorfg --bold
set -x color_vi_mode_visual bryellow $colorfg --bold set -x color_vi_mode_visual bryellow $colorfg --bold
set -x color_aws_id yellow $colorfg
set -x color_vagrant brcyan $colorfg set -x color_vagrant brcyan $colorfg
set -x color_k8s magenta white --bold set -x color_k8s magenta white --bold
set -x color_username grey black --bold set -x color_username grey black --bold
@ -155,6 +161,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $green $white --bold set -x color_vi_mode_insert $green $white --bold
set -x color_vi_mode_visual $yellow $grey --bold set -x color_vi_mode_visual $yellow $grey --bold
set -x color_aws_id $yellow $grey
set -x color_vagrant $blue $green --bold set -x color_vagrant $blue $green --bold
set -x color_k8s $green $white --bold set -x color_k8s $green $white --bold
set -x color_username $grey $blue --bold set -x color_username $grey $blue --bold
@ -203,6 +211,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $base0B $colorfg --bold set -x color_vi_mode_insert $base0B $colorfg --bold
set -x color_vi_mode_visual $base09 $colorfg --bold set -x color_vi_mode_visual $base09 $colorfg --bold
set -x color_aws_id $base09 $colorfg
set -x color_vagrant $base0C $colorfg --bold set -x color_vagrant $base0C $colorfg --bold
set -x color_k8s $base06 $colorfg --bold set -x color_k8s $base06 $colorfg --bold
set -x color_username $base02 $base0D --bold set -x color_username $base02 $base0D --bold
@ -251,6 +261,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $base0B $colorfg --bold set -x color_vi_mode_insert $base0B $colorfg --bold
set -x color_vi_mode_visual $base09 $colorfg --bold set -x color_vi_mode_visual $base09 $colorfg --bold
set -x color_aws_id $base09 $colorfg
set -x color_vagrant $base0C $colorfg --bold set -x color_vagrant $base0C $colorfg --bold
set -x color_k8s $base0B $colorfg --bold set -x color_k8s $base0B $colorfg --bold
set -x color_username $base02 $base0D --bold set -x color_username $base02 $base0D --bold
@ -299,6 +311,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $green $colorfg --bold set -x color_vi_mode_insert $green $colorfg --bold
set -x color_vi_mode_visual $yellow $colorfg --bold set -x color_vi_mode_visual $yellow $colorfg --bold
set -x color_aws_id $yellow $colorfg
set -x color_vagrant $violet $colorfg --bold set -x color_vagrant $violet $colorfg --bold
set -x color_k8s $green $colorfg --bold set -x color_k8s $green $colorfg --bold
set -x color_username $base2 $blue --bold set -x color_username $base2 $blue --bold
@ -347,6 +361,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $green $colorfg --bold set -x color_vi_mode_insert $green $colorfg --bold
set -x color_vi_mode_visual $yellow $colorfg --bold set -x color_vi_mode_visual $yellow $colorfg --bold
set -x color_aws_id $yellow $colorfg
set -x color_vagrant $violet $colorfg --bold set -x color_vagrant $violet $colorfg --bold
set -x color_k8s $green $colorfg --bold set -x color_k8s $green $colorfg --bold
set -x color_username $base02 $blue --bold set -x color_username $base02 $blue --bold
@ -388,6 +404,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $green[2] $grey[3] --bold set -x color_vi_mode_insert $green[2] $grey[3] --bold
set -x color_vi_mode_visual $orange[1] $orange[3] --bold set -x color_vi_mode_visual $orange[1] $orange[3] --bold
set -x color_aws_id $orange[1] $orange[3]
set -x color_vagrant $blue[1] $white --bold set -x color_vagrant $blue[1] $white --bold
set -x color_k8s $green[1] $colorfg --bold set -x color_k8s $green[1] $colorfg --bold
set -x color_username $grey[1] $blue[3] --bold set -x color_username $grey[1] $blue[3] --bold
@ -428,6 +446,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $blue[1] $bg[2] --bold set -x color_vi_mode_insert $blue[1] $bg[2] --bold
set -x color_vi_mode_visual $yellow[1] $bg[2] --bold set -x color_vi_mode_visual $yellow[1] $bg[2] --bold
set -x color_aws_id $yellow[1] $bg[1]
set -x color_vagrant $blue[2] $fg[2] --bold set -x color_vagrant $blue[2] $fg[2] --bold
set -x color_k8s $green[2] $fg[2] --bold set -x color_k8s $green[2] $fg[2] --bold
set -x color_username $fg[3] $blue[2] --bold set -x color_username $fg[3] $blue[2] --bold
@ -470,6 +490,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $green $bg --bold set -x color_vi_mode_insert $green $bg --bold
set -x color_vi_mode_visual $orange $bg --bold set -x color_vi_mode_visual $orange $bg --bold
set -x color_aws_id $yellow $bg
set -x color_vagrant $pink $bg --bold set -x color_vagrant $pink $bg --bold
set -x color_k8s $green $fg --bold set -x color_k8s $green $fg --bold
set -x color_username $selection $cyan --bold set -x color_username $selection $cyan --bold
@ -518,6 +540,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $base06 $colorfg --bold set -x color_vi_mode_insert $base06 $colorfg --bold
set -x color_vi_mode_visual $base07 $colorfg --bold set -x color_vi_mode_visual $base07 $colorfg --bold
set -x color_aws_id $base0D $colorfg
set -x color_vagrant $base02 $colorfg --bold set -x color_vagrant $base02 $colorfg --bold
set -x color_k8s $base02 $colorfg --bold set -x color_k8s $base02 $colorfg --bold
set -x color_username $base02 $base0D --bold set -x color_username $base02 $base0D --bold
@ -560,6 +584,8 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -x color_vi_mode_insert $green[2] $grey[3] --bold set -x color_vi_mode_insert $green[2] $grey[3] --bold
set -x color_vi_mode_visual $orange[1] $orange[3] --bold set -x color_vi_mode_visual $orange[1] $orange[3] --bold
set -x color_aws_id $orange[1] $orange[3]
set -x color_vagrant $blue[1] $white --bold set -x color_vagrant $blue[1] $white --bold
set -x color_k8s $green[2] $white --bold set -x color_k8s $green[2] $white --bold
set -x color_username $grey[1] $blue[3] --bold set -x color_username $grey[1] $blue[3] --bold
@ -587,6 +613,7 @@ function __bobthefish_user_color_scheme_deprecated
set -q __color_vi_mode_default; or set -l __color_vi_mode_default 999999 333333 --bold set -q __color_vi_mode_default; or set -l __color_vi_mode_default 999999 333333 --bold
set -q __color_vi_mode_insert; or set -l __color_vi_mode_insert 189303 333333 --bold 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_vi_mode_visual; or set -l __color_vi_mode_visual f6b117 3a2a03 --bold
set -q __color_aws_id; or set -l __color_aws_id f6b117 3a2a03 --bold
set -q __color_vagrant; or set -l __color_vagrant 48b4fb ffffff --bold set -q __color_vagrant; or set -l __color_vagrant 48b4fb ffffff --bold
set -q __color_username; or set -l __color_username cccccc 255e87 --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_hostname; or set -l __color_hostname cccccc 255e87
@ -623,6 +650,7 @@ function __bobthefish_user_color_scheme_deprecated
set -x color_vi_mode_default $__color_vi_mode_default set -x color_vi_mode_default $__color_vi_mode_default
set -x color_vi_mode_insert $__color_vi_mode_insert set -x color_vi_mode_insert $__color_vi_mode_insert
set -x color_vi_mode_visual $__color_vi_mode_visual set -x color_vi_mode_visual $__color_vi_mode_visual
set -x color_aws_id $__color_aws_id
set -x color_vagrant $__color_vagrant set -x color_vagrant $__color_vagrant
set -x color_username $__color_username set -x color_username $__color_username
set -x color_hostname $__color_hostname set -x color_hostname $__color_hostname