axemoji: Use nicer emoji for righthand error notice
[ax-zsh.git] / themes / axemoji.axzshtheme
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # axemoji.axzshtheme: Fancier AX-ZSH Theme
3
4 ZSH_THEME_PROMPT_PREFIX_SPACING=" "
5 ZSH_THEME_PROMPT_SUFFIX_SPACING=" "
6
7 if axzsh_is_widechar_terminal; then
8         # UTF8 capable terminal:
9         if [[ -r "$HOME/.system_emoji-$SHORT_HOST" ]]; then
10                 system_emoji=$(<"$HOME/.system_emoji-$SHORT_HOST")
11         elif [[ -r "$HOME/.system_emoji" ]]; then
12                 system_emoji=$(<"$HOME/.system_emoji")
13         else
14                 system_emoji="🍀"
15         fi
16         [[ -n "$VTE_VERSION" ]] \
17                 && emoji_spacing="" \
18                 || emoji_spacing=" "
19
20         ZSH_THEME_VCS_PROMPT_CLEAN="👌$emoji_spacing"
21         ZSH_THEME_VCS_PROMPT_DIRTY="👻$emoji_spacing"
22
23         # Primary prompt on the right-hand side.
24         RPS1="%(?..%{$fg_no_bold[red]%}🤔$emoji_spacing %?↵%{$reset_color%})"
25 else
26         # Non-UTF8 or incompatible terminal
27         system_emoji=">"
28         emoji_spacing=""
29
30         # Primary prompt on the right-hand side.
31         RPS1="%(?..%{$fg_no_bold[red]%}<%?>%{$reset_color%})"
32 fi
33
34 # The primary prompt string, printed before a command is read.
35 PS1="${system_emoji}${emoji_spacing} $(ax_logname_prompt_yn)$(ax_hostname_prompt_yn)%B%2~%b"'$(ax_vcs_prompt)'"$(ax_prompt)"
36
37 # Default execution trace prompt.
38 PS4="$fg_no_bold[yellow]->$reset_color "
39 # This prompt is compatible with sh(1) and bash(1), too, so export it!
40 export PS4
41
42 unset system_emoji emoji_spacing