Last active
March 28, 2018 23:22
-
-
Save aMoniker/581545ac59d27be7e55c9eafbf77fd25 to your computer and use it in GitHub Desktop.
Dragon Prompt
This file contains hidden or 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
# time-dragon.zsh-theme | |
THISFILE=${BASH_SOURCE:-$0} | |
DRAGON="π" | |
DRAGON_SLEEP="π²π€" | |
BED="π " | |
FIRE='π₯' | |
CLOCKFACES=( π π π π π π π π π π π π π π π π π π π π π π π π ) | |
HOUR=`date +%H` # current hour | |
STARTHOUR=08 # first clock to show | |
ENDHOUR=19 # last clock to show | |
PROMPT_TOP='' | |
PROMPT_BOT='' | |
# If we're outside the bounds of the start/end hours, show the sleeping dragon | |
if [[ $HOUR -gt $ENDHOUR || $HOUR -lt $STARTHOUR ]]; then | |
PROMPT_TOP=$DRAGON_SLEEP | |
PROMPT_BOT=$BED | |
else | |
# otherwise, show the burned and remaining clocks | |
for i in `seq $STARTHOUR $ENDHOUR`; do | |
if [[ $i -lt $HOUR ]]; then | |
PROMPT_TOP="$PROMPT_TOP$FIRE" | |
else | |
PROMPT_TOP="$PROMPT_TOP$CLOCKFACES[$i + 1]" | |
fi | |
done | |
PROMPT_BOT=$DRAGON | |
fi | |
# Assemble the full prompt and assign it to the ZSH PROMPT var | |
PROMPT=$'\n$PROMPT_TOP $FG[032]%~%{$reset_color%}\n$PROMPT_BOT ' | |
# Refresh the prompt every minute | |
periodic() { | |
source $THISFILE | |
} | |
PERIOD=60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment