]> arthur.barton.de Git - ax-zsh.git/blob - themes/axemoji.axzshtheme
P10k: Read config after enabling instant prompt
[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_utf_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         axzsh_is_widechar_terminal \
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 axzsh_logname_prompt_functions=($axzsh_logname_prompt_functions axzsh_logname_prompt_root)
35 axzsh_hostname_prompt_functions=($axzsh_hostname_prompt_functions axzsh_hostname_prompt_root)
36
37 # The primary prompt string, printed before a command is read.
38 PS1="${system_emoji}${emoji_spacing} $(axzsh_logname_prompt_yn)$(axzsh_hostname_prompt_yn)%B%2~%b"'$(axzsh_vcs_prompt)'"$(axzsh_prompt)"
39
40 # Default execution trace prompt.
41 PS4="$fg_no_bold[yellow]->$reset_color "
42 # This prompt is compatible with sh(1) and bash(1), too, so export it!
43 export PS4
44
45 unset system_emoji emoji_spacing