Skip to content

Instantly share code, notes, and snippets.

@Nitrodist
Last active July 19, 2019 20:20
Show Gist options
  • Save Nitrodist/90241f17e92df7bb71d00f3656bc04a8 to your computer and use it in GitHub Desktop.
Save Nitrodist/90241f17e92df7bb71d00f3656bc04a8 to your computer and use it in GitHub Desktop.
current_hour=${CURRENT_HOUR:-$(date "+%k")}
# I have no idea how to get the actual list of colors but this has some colors in the screenshot
# https://gabri.me/blog/custom-colors-in-your-zsh-prompt
# Set the color value
work_color=154
keep_going_color=157
wrap_up_color=34
late_color=163
really_late_color=160
really_late=0
work=4
keep_going=20
wrap_up=22
late=23
PS1_text_color="foo"
if [[ $late -le $current_hour ]]; then
PS1_text_color=$late_color
elif [[ $wrap_up -le $current_hour ]]; then
PS1_text_color=$wrap_up_color
elif [[ $keep_going -le $current_hour ]]; then
PS1_text_color=$keep_going_color
elif [[ $work -le $current_hour ]]; then
PS1_text_color=$work_color
else
PS1_text_color=$really_late_color
fi
PROMPT="%{%F{"${PS1_text_color}"%}%}%D{%Y-%m-%d} %* %{%B%}%~%{%b%} %m %{%B%}%#%{%b%}: %f"
# 2019-07-19 15:15:45 ~/dotfiles Marks-MacBook-Air %:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment