diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-14 15:42:48 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-14 15:43:24 -0800 |
| commit | c1c32688a4afc43f6addb99b8b5fa878944a70e3 (patch) | |
| tree | c886f21b5b08a9053aa74fcba4b241dae5ede76d /lib/progressbar | |
| parent | 2309b696fc34b24f05f6658b94f9105ca8ee76e4 (diff) | |
Overhaul in progress, mostly working. Moved all the nomsu packages into
lib/, including core/*. Changes to how nomsu environments and importing
work.
Diffstat (limited to 'lib/progressbar')
| -rw-r--r-- | lib/progressbar/init.nom | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/progressbar/init.nom b/lib/progressbar/init.nom new file mode 100644 index 0000000..a7ff5aa --- /dev/null +++ b/lib/progressbar/init.nom @@ -0,0 +1,16 @@ +# A progress bar + +externally ($x / $w progress bar) means: + $x = ($x clamped between 0 and $w) + $bits = [" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"] + $middle = + "" if ($x == $w) else + $bits.(1 + (floor ((#$bits) * ($x mod 1)))) + + return (" + \027[32;40m\($bits, last, rep (floor $x))\$middle\ + ..\(" ", rep ($w - ((floor $x) + 1)))\027[0m + ") + +externally ($w wide $ progress bar) means + ($ * $w) / $w progress bar |
