added watchit
This commit is contained in:
parent
c680720b44
commit
42f3a6052d
15
.local/bin/tools/watchit
Executable file
15
.local/bin/tools/watchit
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user