-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmajemoji.zsh-theme
More file actions
22 lines (19 loc) · 979 Bytes
/
majemoji.zsh-theme
File metadata and controls
22 lines (19 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Majemoji: Magical emojis in your your terminal.
# Extension by @catonmat: https://github.com/catonmat
# Inspired by the Robby Russell Theme: https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
EMOJIS=("🦄" "🧞" "🔥" "🍎" "🌙" "🧟" "🍉" "🚗" "🐒")
NUMBER_EMOJIS=${#EMOJIS[@]}
RANDOM_EMOJI=$(( ($RANDOM % ${NUMBER_EMOJIS}) ))
if [ $RANDOM_EMOJI -eq 0 ]
then
# array begins with index 1, but random number includes 0.
# 0 index emoji must be set to last emoji, otherwise it will never be rendered.
RANDOM_EMOJI=$NUMBER_EMOJIS
fi
# issue standard robbyrussell prompter
PROMPT="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})${EMOJIS[$RANDOM_EMOJI]} "
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"