Compare commits

...

3 commits

3 changed files with 48 additions and 6 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash
sleep 0.2 # let wezterm catch up
COLUMNS=$(tput cols)
@ -10,21 +11,28 @@ line() {
done
}
echo
peoples() {
i=1
while [[ $i -le $COLUMNS ]]; do
echo -en "\U1FBC$((RANDOM % 5 +5))"
i=$((i + 1))
done
}
print-line() {
awk -v columns="$COLUMNS" -v s="$(line)" \
awk -v columns="$COLUMNS" -v s="$1" \
'BEGIN{
for (colnum = 0; colnum<columns+1; colnum++) {
r = 255-(colnum*255/columns);
g = (colnum*510/columns);
b = (colnum*255/columns);
if (g>255) g = 510-g;
printf "\033[38;2;%d;%d;%d;49m", r,g,b;
printf "\033[38;2;%d;%d;%d;49;4m", r,g,b;
printf "%s\033[0m", substr(s,colnum+1,1);
}
printf "\n";
}'
}
print-line
print-line
echo
print-line "$(peoples)"

34
bin/print-epoch Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env bash
COLUMNS=$(tput cols)
digit() {
echo -en "\U1FBF$1 "
}
print-time() {
TIMESTAMP="$1"
for (( i=0; i<${#TIMESTAMP}; i++ )); do
digit "${TIMESTAMP:$i:1}"
done
}
spacing() {
for (( i=0; i<$1; i++ )); do
printf "%s" "-"
done
}
epoch=$(print-time "$(date +'%s')")
side=$(spacing $(((COLUMNS-(${#epoch}+6))/2)))
print-line() {
printf "\n\033[1m%s [ \033[1;9%dm%s\033[39m ] %s\033[0m\n" \
"$side" \
"$((RANDOM % 7+1))" \
"$1" \
"$side"
}
print-line "$epoch"

View file

@ -34,5 +34,5 @@ unset EXTRAFILE
export DOTFILES_DIR DOTFILES_EXTRA_DIR
# welcome art
! is-tty && $DOTFILES_DIR/bin/gradient
! is-tty && $DOTFILES_DIR/bin/print-epoch