2022-02-09 07:29:05 +00:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
declare clear=$'\034[2J'
|
|
|
|
declare top=$'\033[H'
|
|
|
|
|
|
|
|
repeat() {
|
|
|
|
for ((i=0;i<$2;i++)); do echo -n "$1"; done
|
|
|
|
}
|
|
|
|
|
|
|
|
marquee() {
|
|
|
|
local topic time right cols pomo
|
|
|
|
local -i topicremain timeremain timew topicw
|
|
|
|
local -a timebar topicbar
|
|
|
|
#topic="$(topic)" topic="${topic#* }"
|
|
|
|
topic="$(head -1 ~/.currently)"
|
2022-02-15 04:36:21 +00:00
|
|
|
pomo="$(pomo)"
|
2022-02-09 07:29:05 +00:00
|
|
|
#mode="$(iam mode emoji)"
|
|
|
|
zet="zet:$(zet current)"
|
2022-03-06 23:09:46 +00:00
|
|
|
time="$(date +"%A, %B %-e, %Y, %-I:%M%p %Z%0z")"
|
|
|
|
isosec="$(isosec)"
|
2022-02-09 07:29:05 +00:00
|
|
|
tilboost="$(countdown 11:11:11 May 4)"
|
2022-02-15 04:36:21 +00:00
|
|
|
#[[ -n "$pomo" ]] && timebar+=("$pomo")
|
|
|
|
#[[ -n "$pomo" ]] && topicbar+=("$pomo")
|
2022-02-09 07:29:05 +00:00
|
|
|
[[ -n "$time" ]] && timebar+=("$time")
|
|
|
|
[[ -n "$topic" ]] && topicbar+=("$topic")
|
|
|
|
timebarb="${timebar[*]}"
|
|
|
|
topicbarb="${topicbar[*]}"
|
|
|
|
topicremain=$(( $(tput cols) - ${#topicbarb} ))
|
|
|
|
timeremain=$(( $(tput cols) - ${#timebarb} ))
|
|
|
|
topicspace=$(( topicremain - ${#mode} - ${#zet}))
|
2022-03-06 23:09:46 +00:00
|
|
|
timespace=$(( timeremain - ${#mode} - ${#zet} - ${#tilboost} - ${#isosec}))
|
2022-02-09 07:29:05 +00:00
|
|
|
#if (( $(date +%s)%20 < 10 ));then
|
|
|
|
#echo "$topicbarb $(repeat $' ' "$topicspace") rwxrob.tv"
|
|
|
|
#else
|
|
|
|
#echo "$mode $timebarb $(repeat $' ' "$timespace") rwxrob.tv $zet"
|
2022-02-15 04:36:21 +00:00
|
|
|
#echo "$timebarb $replay [boost in $tilboost] $(repeat $' ' "$timespace") rwxrob.tv"
|
2022-10-08 07:27:01 +00:00
|
|
|
#echo "$timebarb ($isosec) [boost: $tilboost]"
|
|
|
|
echo "$timebarb ($isosec)"
|
2022-02-09 07:29:05 +00:00
|
|
|
#fi
|
|
|
|
}
|
|
|
|
|
|
|
|
marquee "$@"
|
|
|
|
|
|
|
|
# if [[ -t 1 ]];then
|
|
|
|
# trap "setterm --cursor on; echo $clear; exit; trap -- - SIGINT SIGTERM" SIGTERM SIGINT
|
|
|
|
# setterm --cursor off
|
|
|
|
# while true; do
|
|
|
|
# echo -n "$clear$top"
|
|
|
|
# marquee "$@"
|
|
|
|
# sleep 1
|
|
|
|
# done
|
|
|
|
# fi
|