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