use epoc time based welcome screen
This commit is contained in:
parent
20c7b6e823
commit
6851fe185d
2 changed files with 31 additions and 1 deletions
30
bin/print-epoch
Executable file
30
bin/print-epoch
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/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)))
|
||||
|
||||
printf "\n\033[1m%s [ \033[1;9%dm%s\033[39m ] %s\033[0m\n" \
|
||||
"$side" \
|
||||
"$((RANDOM % 7+1))" \
|
||||
"$epoch" \
|
||||
"$side"
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue