Created
November 1, 2019 10:39
-
-
Save tpiros/6cd3f690d136297cdd2af1ac37288d10 to your computer and use it in GitHub Desktop.
Adding emojis to ZSH theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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