candy-kingdom.zsh-theme 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. if ! hg prompt 2>/dev/null; then
  2. function hg_prompt_info { }
  3. else
  4. function hg_prompt_info {
  5. hg prompt --angle-brackets "\
  6. < on %{$fg[magenta]%}<branch>%{$reset_color%}>\
  7. < at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
  8. %{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
  9. patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
  10. }
  11. fi
  12. function box_name {
  13. [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
  14. }
  15. PROMPT='
  16. %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
  17. %(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
  18. ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
  19. ZSH_THEME_GIT_PROMPT_CLEAN=""
  20. ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
  21. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
  22. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
  23. RPROMPT='%{$fg[red]%}%(?..✘)%{$reset_color%}'
  24. # Add battery status if the battery plugin is enabled
  25. if (( $+functions[battery_pct_prompt] )); then
  26. RPROMPT+='$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
  27. fi