commit f12d9ae1c08baf04ad3ca2d4ccfe60d710570d91
parent d99f2d53f61f8596becd4d509d3d141e4e740fe2
Author: Vincent Demeester <vincent@sbr.pm>
Date: Tue, 3 May 2022 09:56:20 +0200
users/vincent: add docker_host to prompt
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/users/vincent/core/zsh/prompt.zsh b/users/vincent/core/zsh/prompt.zsh
@@ -67,6 +67,7 @@
# ram # free RAM
# load # CPU load
in_nix_shell
+ docker_host
time # current time
# =========================[ Line #2 ]=========================
#newline
@@ -839,6 +840,12 @@
fi
fi
}
+
+ function prompt_docker_host() {
+ if test -n "${DOCKER_HOST}"; then
+ p10k segment -f blue -i '🐋' -t "${DOCKER_HOST}"
+ fi
+ }
# User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
# is to generate the prompt segment for display in instant prompt. See
# https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
@@ -853,6 +860,10 @@
prompt_in_nix_shell
}
+ function instant_prompt_docker_host() {
+ prompt_docker_host
+ }
+
# User-defined prompt segments can be customized the same way as built-in segments.
# typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208
# typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐'