Skip to content

Instantly share code, notes, and snippets.

@tpiros
Created November 1, 2019 10:39
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tpiros/6cd3f690d136297cdd2af1ac37288d10 to your computer and use it in GitHub Desktop.
Save tpiros/6cd3f690d136297cdd2af1ac37288d10 to your computer and use it in GitHub Desktop.
Adding emojis to ZSH theme
# On a Mac: /Users/<username>/.oh-my-zsh/custom/themes
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
local emojis=("πŸ‘‹" "🀑" "πŸ¦„" "πŸ€™" "🐼" "😊" "πŸ”₯" "⚑" "😎" "🌎")
local selectedEmoji=${emojis[$[1+($RANDOM%${#emojis[@]})]]}
local today=$(date +%m.%d)
# local ipCountry=`curl -s ip-api.com/json | python -c "import sys, json; print json.load(sys.stdin)['country']"`
#Β local country=$emoji_flags[${ipCountry}]
# }
case $today in
"01.01")
extra="πŸŽ†"
;;
"10.31")
extra="πŸŽƒ"
;;
"12.06")
extra="πŸŽ…πŸΌ "
;;
"12.24")
extra="πŸŽ„"
;;
"12.25")
extra="πŸŽ„"
;;
"12.26")
extra="🎁"
;;
"12.31")
extra="πŸŽ‰"
;;
*)
;;
esac
if [ "$extra" != "" ]
then
PROMPT='${ret_status} ${selectedEmoji} ${extra} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
else
PROMPT='${ret_status} ${selectedEmoji} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
fi
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]%})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment