aboutsummaryrefslogtreecommitdiffstats
path: root/devi.zsh-theme
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--devi.zsh-theme12
1 files changed, 11 insertions, 1 deletions
diff --git a/devi.zsh-theme b/devi.zsh-theme
index f64505e..38f167f 100644
--- a/devi.zsh-theme
+++ b/devi.zsh-theme
@@ -59,6 +59,7 @@ if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
yablue="%F{32}"
yagreen="%F{34}"
babyblue="%F{39}"
+ somegreen="%F{22}"
else
turquoise="$fg[cyan]"
orange="$fg[yellow]"
@@ -262,8 +263,17 @@ rebuildquery() {
fi
}
+zstyle ':zsh-kubectl-prompt:' separator ':'
+getkubernetesinfo() {
+ local SUB_PROMPT="%{$somegreen%}<$ZSH_KUBECTL_USER:$ZSH_KUBECTL_PROMPT>%{$reset_color%}"
+ if [[ "$ZSH_KUBECTL_USER" =~ "admin" ]];then
+ SUB_PROMPT="%{$someblue%}<$ZSH_KUBECTL_PROMPT>%{$reset_color%}"
+ fi
+ echo $SUB_PROMPT
+}
-PS1=$'%{$new2%}$(sudo_query)%{$reset_color%}%{$swampgreen%}%n%{$reset_color%} on %{$purblue%}%M%{$reset_color%} in %{$yagreen%}$(pwd_shortened)%{$reset_color%} at %{$muckgreen%}$(time_function)%{$reset_color%}$vcs_info_msg_0_%{$limblue%}%{$gnew%}$(gitadditions)%{$gnew2%}$(gitdeletions)%{$reset_color%}%{$deeppink%}$(virtualenv_info)%{$reset_color%}%{$teal%}$(node_version)%{$reset_color%}%{$gover%}$(goversion)%{$reset_color%}%{$rust%}$(rustversion)%{$reset_color%}%{$babyblue%}$(ruby_version)%{$reset_color%}%{$sneakyc%}$(sneaky)%{$reset_color%}%{$new%}$(rebuildquery)%{$reset_color%} %{$someblue%}<$ZSH_KUBECTL_PROMPT>%{$reset_color%}%{$batred%}$(dir_writeable)%{$reset_color%}'
+# PS1=$'%{$new2%}$(sudo_query)%{$reset_color%}%{$swampgreen%}%n%{$reset_color%} on %{$purblue%}%M%{$reset_color%} in %{$yagreen%}$(pwd_shortened)%{$reset_color%} at %{$muckgreen%}$(time_function)%{$reset_color%}$vcs_info_msg_0_%{$limblue%}%{$gnew%}$(gitadditions)%{$gnew2%}$(gitdeletions)%{$reset_color%}%{$deeppink%}$(virtualenv_info)%{$reset_color%}%{$teal%}$(node_version)%{$reset_color%}%{$gover%}$(goversion)%{$reset_color%}%{$rust%}$(rustversion)%{$reset_color%}%{$babyblue%}$(ruby_version)%{$reset_color%}%{$sneakyc%}$(sneaky)%{$reset_color%}%{$new%}$(rebuildquery)%{$reset_color%} %{$someblue%}<$ZSH_KUBECTL_USER:$ZSH_KUBECTL_PROMPT>%{$reset_color%}%{$batred%}$(dir_writeable)%{$reset_color%}'
+PS1=$'%{$new2%}$(sudo_query)%{$reset_color%}%{$swampgreen%}%n%{$reset_color%} on %{$purblue%}%M%{$reset_color%} in %{$yagreen%}$(pwd_shortened)%{$reset_color%} at %{$muckgreen%}$(time_function)%{$reset_color%}$vcs_info_msg_0_%{$limblue%}%{$gnew%}$(gitadditions)%{$gnew2%}$(gitdeletions)%{$reset_color%}%{$deeppink%}$(virtualenv_info)%{$reset_color%}%{$teal%}$(node_version)%{$reset_color%}%{$gover%}$(goversion)%{$reset_color%}%{$rust%}$(rustversion)%{$reset_color%}%{$babyblue%}$(ruby_version)%{$reset_color%}%{$sneakyc%}$(sneaky)%{$reset_color%}%{$new%}$(rebuildquery)%{$reset_color%} $(getkubernetesinfo)%{$batred%}$(dir_writeable)%{$reset_color%}'
PS2=$''
PS3=$'\n%{$limblue%}--➜%{$reset_color%}'
get_prompt_len() {