From d64e412e07010b87860a4241f8e4e67bf1a21a44 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sun, 16 Jun 2024 11:03:50 +0200 Subject: [PATCH] add helix-man.sh --- helix-man.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 helix-man.sh diff --git a/helix-man.sh b/helix-man.sh new file mode 100644 index 0000000..b6fff65 --- /dev/null +++ b/helix-man.sh @@ -0,0 +1,24 @@ +#!/bin/bash +PORT=$1 + +if [ "$PORT" = "" ] ; then + export PORT=7400 +fi + +nc localhost $PORT < /dev/null | ( + echo & + while true; do + read PAGE || break + TOKILL="$(ps --ppid $MANPID -o pid=)" + kill $TOKILL > /dev/null + echo displaying $PAGE + man -P less -s 2:3:1p:9:1 $PAGE & + MANPID=$! + sleep 0.1 + done + TOKILL="$(ps --ppid $MANPID -o pid=)" + kill $TOKILL > /dev/null +) 2> /dev/null + +exit 0 +