tui.sh

terminal user interface only bash without ncurses.

Download as .zip Download as .tar.gz View on GitHub

tui.sh

minimum Text User Interface in bash without ncurses.
just edit yaml and deploy or use in everyday workflow.

Table of Contents

features

on terminal, just two files

+ tui on web

usage


❯ ./tui.sh --help

   Usage: tui.sh [--yaml YAMLFILE] [--root ROOTPATH] [--dbgfile DEBUGFILE] [--rtime TIMESECOND]
                    [--debug] [--dry-run]

   optional arguments:
     -h, --help                 show this help message and exit
     -y, --yaml YAMLFILE        yaml menu file(default./tui.sh.yaml)
     -r, --root ROOTPATH        absolute path of starting point on tree(default. /bkit)
     -b, --dbgfile DEBUGFILE    debug file path(default. ./tui.debug.log)
     -t, --rtime TIMESECOND     screen refresh time in float second(default. 1.1)
     -d, --debug                debug of the bash script
     --dry-run                  do a dry run, check only md file and exit

tui.sh.yaml

menu and what to do in the menu in the tui.sh app. realworld example for bkit tui.sh.yaml(github)

---
bkit: # root name
  _sha256sum: https://pastebin.com/raw/RscMWHhe # hash check for neccessary files.(tui.sh, tui.sh.yaml tui_web.tar.gz)
  _description: various setup scripts for security. # menu description.
  _batch: ["beginner", "advanced"] # set category for inclustion, exclustion at batch run.
  _keycode: b # keycode on enter the menu.
  _cmd:
    - echo "show output. no control" # command to run on screen without control.
    - sleep 100 & # run background as child processor. no control.
    - exec 1>**_tty_** && $EDITOR file # run on foregound over tui. control.
  _link:
    control: "/bkit/submenu" # direct menu link to other tree in control. . not implemented.
    link: "https://github.com/xxx/xxx" # web link. not implemented.
  status: # normal type submenu
    _description: status menu
    _keycode: t
    _cmd: echo "" # command entry to run on background.
  toggle: # on/off toggle type menu
    _keycode: g
    _description: toogle menu for on / off
    _cmd: echo ""
    _type: toggle # toggle type needs, _check_cmd and _disable_cmd attributes.
    _check_cmd: if [ -z ${tui_toggle+x} ]; then echo 1 && tui_toggle=1; else echo 0 && unset tui_toggle; fi # _check_cmd for enabled(print 1 or any string) or disabled(echo 0 or empty string)
    _disable_cmd: echo ""

for developers

stuff to modify tui.sh.

runtime hash check

download tui.sh hash
https://raw.githubusercontent.com/solidjs/solid/v1.8.0/LICENSE https://cdn.jsdelivr.net/gh/solidjs/[email protected]/LICENSE https://cdn.statically.io/gh/solidjs/solid/v1.8.0/LICENSE https://cdn.staticdelivr.com/gh/solidjs/solid/v1.8.0/LICENSE https://ghproxy.com/https://raw.githubusercontent.com/solidjs/solid/v1.8.0/LICENSE

forbid to use git clone, wget, curl commands in yaml file

simple blocker for not to use script for binary download and runner.
tui.sh is scan input yaml file whether including git clone, wget, curl default.
please put your binary or setup script downloaded by end-user themselves if possible.

debug system

tui.sh –loglv 3
_tui_log 4 “test”

cat tui.debug.log

process histories

[UP/DOWN] [C]lose
navigate through node on tree will generates process hitories like book page.
travel histories by arrow-up and arrow-down key. and close it by put [C] key.

pagenations

[j/k]
in single node or process, travel logs by putting [j] key for page-up and page-down for [k] key.

httpd switch

[t]web
httpd can be turned on with [t] key.

communication with darkhttpd

todo