summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorache <ache@ache.one>2022-10-31 02:23:33 +0100
committerache <ache@ache.one>2022-10-31 02:23:33 +0100
commit870a8bf0f9d8f55549c2bccf4ee28a71353d30c7 (patch)
treeecbefa03b37da78afe96d7965d6d25b52dcbed97 /functions
parentAdd multiple aliases (diff)
Add ☁️ related prompts
Diffstat (limited to 'functions')
-rw-r--r--functions/fish_prompt.fish12
1 files changed, 12 insertions, 0 deletions
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