Skip to content

Instantly share code, notes, and snippets.

@JackPott
Created July 17, 2020 13:39
Show Gist options
  • Save JackPott/3b6083ac490d73f312cbf2095bd06582 to your computer and use it in GitHub Desktop.
Save JackPott/3b6083ac490d73f312cbf2095bd06582 to your computer and use it in GitHub Desktop.
# config.fish
set -g theme_display_aws yes
# fish_prompt.fish
function __bobthefish_prompt_aws_profile -S -d 'Put the AWS or AWS_VAULT profile on the powerline'
[ "$theme_display_aws" = 'yes' ]
or return
set aws_glyph \uf0c2 '' # nf-mdi-cloud
# Ensure the aws command is available
type -q aws; or return
set -l PROFILE_NAME
# if aws-vault is in use, override profile with that
if test -n "$AWS_VAULT"
set PROFILE_NAME "$AWS_VAULT"
else
set PROFILE_NAME "$AWS_PROFILE"
end
# Early return if there's no named profile, or it's set to default
if test -z "$PROFILE_NAME" \
-o "$PROFILE_NAME" = "default"
return
end
__bobthefish_start_segment $color_vi_mode_visual
echo -n "$aws_glyph$PROFILE_NAME "
end
__bobthefish_prompt_aws_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment