From 870a8bf0f9d8f55549c2bccf4ee28a71353d30c7 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 31 Oct 2022 02:23:33 +0100 Subject: =?UTF-8?q?Add=20=E2=98=81=EF=B8=8F=20related=20prompts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/fish_prompt.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'functions') diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index ffd7da2..49e7383 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -103,6 +103,17 @@ function prompt_user -d "Display current user if different from $default_user" end end +function prompt_cloud -d "Display a Cloud if AWS connection detected" + set -g HOSTNAME_PROMPT "" + if [ "$AWS_PROFILE" != "" ] + prompt_segment 494949 DDDDDD "☸️ $AWS_PROFILE" + else + if [ "$AWS_DEFAULT_PROFILE" != "" ] + prompt_segment 494949 BBBBBB "🌩 $AWS_DEFAULT_PROFILE" + end + end +end + function get_hostname -d "Set current hostname to prompt variable $HOSTNAME_PROMPT if connected via SSH or is root" set -g HOSTNAME_PROMPT "" if [ "$theme_hostname" = "always" -o \( "$theme_hostname" != "never" -a \( -n "$SSH_CLIENT" -o "$USER" = "root" \) \) ] @@ -285,5 +296,6 @@ function fish_prompt prompt_user prompt_dir available git; and prompt_git + prompt_cloud prompt_finish end -- cgit v1.2.3