If you're running zsh, I suggest using powerlevel10k[0]. It is stupid fast, and extremely customisable.
function prompt_epoch() {
MYEPOCH=$(/bin/date +%s | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')
p10k segment -f 66 -t ${MYEPOCH}
}
It looks like this in action: $ zmodload -F zsh/datetime p:EPOCHSECONDS
$ printf "%'d" $EPOCHSECONDS
1,648,943,504 function prompt_epoch() {
p10k segment -f 66 -t ${MYEPOCH} <-- replace MYEPOCH with EPOCHSECONDS but with commas?
}
EDIT: printf can assign output to a variable using -v. Therefore my function can be rewritten as: function prompt_epoch() {
printf -v COMMA_EPOCH "%'d" ${EPOCHSECONDS}
p10k segment -f 66 -t ${COMMA_EPOCH}
}Powerlevel10k is very customisable, faster, can be configured to function exactly like Pure out of the box and in my experience, more reliable.
I would recommend powerlevel10k over Pure any day. But it’s just an anecdotal datapoint.
Edit: Well that was easier than expected, their initial setup daemon is pretty well made, and the "instant prompt" is pretty cool. Feels snappy.