mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
feat(apple): randomize logo color
This commit is contained in:
parent
9e2c1548c3
commit
61280322e3
1 changed files with 6 additions and 5 deletions
|
|
@ -1,7 +1,3 @@
|
||||||
function toon {
|
|
||||||
echo -n ""
|
|
||||||
}
|
|
||||||
|
|
||||||
autoload -Uz vcs_info
|
autoload -Uz vcs_info
|
||||||
zstyle ':vcs_info:*' check-for-changes true
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
|
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
|
||||||
|
|
@ -15,10 +11,15 @@ zstyle ':vcs_info:*' enable git cvs svn
|
||||||
|
|
||||||
theme_precmd () {
|
theme_precmd () {
|
||||||
vcs_info
|
vcs_info
|
||||||
|
|
||||||
|
local apple_colors=(red green yellow blue magenta cyan white)
|
||||||
|
local random_color=$apple_colors[$(( RANDOM % ${#apple_colors[@]} + 1 ))]
|
||||||
|
|
||||||
|
APPLE_PROMPT="%F{$random_color}%f"
|
||||||
}
|
}
|
||||||
|
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
|
PROMPT='${APPLE_PROMPT} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
|
||||||
|
|
||||||
autoload -U add-zsh-hook
|
autoload -U add-zsh-hook
|
||||||
add-zsh-hook precmd theme_precmd
|
add-zsh-hook precmd theme_precmd
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue