diff --git a/.local/bin/tools/watchit b/.local/bin/tools/watchit new file mode 100755 index 0000000..7ec93dd --- /dev/null +++ b/.local/bin/tools/watchit @@ -0,0 +1,15 @@ +#!/bin/sh +HOME=$(tput cup 0 0) +ED=$(tput ed) +EL=$(tput el) +printf '%s%s' "$HOME" "$ED" +while true +do + ROWS=$(tput lines) + COLS=$(tput cols) + CMD="$*" + ${SHELL:=sh} -c "$CMD" | head -n $ROWS | while IFS= read LINE; do + printf '%-*.*s%s\n' $COLS $COLS "$LINE" "$EL" + done + printf '%s%s' "$ED" "$HOME" +done