]> arthur.barton.de Git - ax-zsh.git/blob - themes/axemoji.axzshtheme
axemoji.axzshtheme: Disable it on incompatible terminals
[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 enable_emoji=1
8
9 [[ "$TERM_PROGRAM" = "Hyper" ]] && unset enable_emoji
10
11 if [[ -n "$enable_emoji" ]] && axzsh_is_utf_terminal; then
12         # UTF8 capable terminal:
13         if [[ -r "$HOME/.system_emoji-$SHORT_HOST" ]]; then
14                 system_emoji=$(<"$HOME/.system_emoji-$SHORT_HOST")
15         elif [[ -r "$HOME/.system_emoji" ]]; then
16                 system_emoji=$(<"$HOME/.system_emoji")
17         else
18                 system_emoji="🍀"
19         fi
20         [[ -n "$VTE_VERSION" ]] \
21                 && emoji_spacing="" \
22                 || emoji_spacing=" "
23
24         ZSH_THEME_VCS_PROMPT_CLEAN="👌$emoji_spacing"
25         ZSH_THEME_VCS_PROMPT_DIRTY="👻$emoji_spacing"
26
27         # Prompt on right side
28         RPS1="%(?..%{$fg_no_bold[red]%}❌$emoji_spacing%? ↵%{$reset_color%})"
29 else
30         # Non-UTF8 or incompatible terminal
31         system_emoji=">"
32         emoji_spacing=""
33
34         RPS1="%(?..%{$fg_no_bold[red]%}<%?>%{$reset_color%})"
35 fi
36
37 PS1="${system_emoji}${emoji_spacing} $(ax_logname_prompt_yn)$(ax_hostname_prompt_yn)%B%2~%b"'$(ax_vcs_prompt)'"$(ax_prompt)"
38
39 unset enable_emoji system_emoji emoji_spacing