From 41bbe69ac1968aa6ba11f901120cadc9426344fc Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 24 Jul 2023 11:17:48 +0300 Subject: [PATCH] line by line mode in timeline --- executor.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/executor.sh b/executor.sh index ba55b23..bc56401 100755 --- a/executor.sh +++ b/executor.sh @@ -44,7 +44,18 @@ while read -r cmd mesg; do reply=$reply_id toot "$status" | jq '.id, .errors' reply='' ;; - "home") timeline_home "$mesg" ;; + "home") + tlhome=$(timeline_home "$mesg") + tlhome_len=$(echo "$tlhome" | wc -l) + current_pos=1 + while read -r cursor; do + if [ ':q' = "$cursor" ]; then break; fi + if [ ':all' = "$cursor" ]; then echo "$tlhome"; break; fi + echo "$tlhome" | awk "NR==$current_pos" + current_pos=$(($current_pos + 1)) + if [ $current_pos -gt $tlhome_len ]; then break; fi + done + ;; "reg") printf 'bbs > '; continue ;; "x") case $mesg in