ticker now properly scales to cols and has a dev option to just be a printf

This commit is contained in:
Nicole O'Connor 2021-08-24 19:10:32 -07:00
parent cfb6228116
commit c520435502
3 changed files with 11 additions and 9 deletions

View File

@ -3,3 +3,4 @@
# control software for whatever unimaginable reason. # control software for whatever unimaginable reason.
_zeeshdev_ignore_updates=0 _zeeshdev_ignore_updates=0
_zeeshdev_ticker_newlines=0

View File

@ -1,11 +1,14 @@
function ticker_message () { cols=$(stty -a | grep -Po '(?<=columns )\d+' | tr -d "\n")
# TODO: get cols and scale
printf "\r \r"
printf "$@" function ticker_message () {
if [[ $_zeeshdev_ticker_newlines == 0 ]]; then
printf "\r${(l:$cols:: :)A}\r"
printf "$@"
else
printf "$@\n"
fi
} }
function ticker_finish () { function ticker_finish () {
# TODO: get cols and scale [[ $_zeeshdev_ticker_newlines == 0 ]] && printf "\r${(l:$cols:: :)A}\r"
printf "\r \r"
} }

View File

@ -3,8 +3,6 @@ source ~/.local/share/zeesh/base/zeesh.zsh
ticker_message "zeesh: bootstrap" ticker_message "zeesh: bootstrap"
cols=$(stty -a | grep -Po '(?<=columns )\d+' | tr -d "\n")
if [[ $cols -lt 80 ]]; then if [[ $cols -lt 80 ]]; then
if [[ $(uname -o) == "Android" ]]; then if [[ $(uname -o) == "Android" ]]; then
hostemoji="📞" hostemoji="📞"