emoji terminal prompt experiment
Small experiment to show the current time in the prompt using emoji:
function prompt_char {
if [ $UID -eq 0 ]; then echo "#"; else echo ฮป; fi
}
clock_array=(๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ก ๐ ๐ข ๐ ๐ฃ ๐ ๐ค ๐ ๐ฅ ๐ ๐ฆ ๐ ๐ง )
function check_hour {
hour_24=`date "+%H"`
hour=`echo "$hour_24 % 12" | bc`
if [ "$hour" -eq 0 ]; then
hour=12
fi
minute=`date "+%M"`
if [ "$minute" -ge 45 -o "$minute" -le 15 ]; then
clock_array_shift=-1
if [ "$minute" -le 59 -a "$minute" -ge 45 ]; then
hour=`echo "$hour + 1" | bc`
fi
else
clock_array_shift=0
fi
clock_index=`echo "(($hour * 2) + $clock_array_shift) % 24" | bc`
clock=${clock_array[$clock_index]}
echo " $clock "
}
PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})$(check_hour) %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
Written by Cristian
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Zsh
Authors
Sponsored by #native_company# โ Learn More
#native_title#
#native_desc#