candy-kingdom.zsh-theme 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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. local box="${SHORT_HOST:-$HOST}"
  14. [[ -f ~/.box-name ]] && box="$(< ~/.box-name)"
  15. echo "${box:gs/%/%%}"
  16. }
  17. PROMPT='
  18. %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
  19. %(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
  20. ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
  21. ZSH_THEME_GIT_PROMPT_CLEAN=""
  22. ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
  23. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
  24. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
  25. RPROMPT='%{$fg[red]%}%(?..✘)%{$reset_color%}'
  26. # Add battery status if the battery plugin is enabled
  27. if (( $+functions[battery_pct_prompt] )); then
  28. RPROMPT+='$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
  29. fi