candy-kingdom.zsh-theme
1318 bytes
1if ! hg prompt 2>/dev/null; then
2 function hg_prompt_info { }
3else
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%}<
9patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
10 }
11fi
12
13function box_name {
14 local box="${SHORT_HOST:-$HOST}"
15 [[ -f ~/.box-name ]] && box="$(< ~/.box-name)"
16 echo "${box:gs/%/%%}"
17}
18
19PROMPT='
20%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
21%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
22
23ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
24ZSH_THEME_GIT_PROMPT_CLEAN=""
25ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
26ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
27ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
28
29RPROMPT='%{$fg[red]%}%(?..✘)%{$reset_color%}'
30
31# Add battery status if the battery plugin is enabled
32if (( $+functions[battery_pct_prompt] )); then
33 RPROMPT+='$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
34fi