First 3 of the 5 pilot apps, all built and screenshot-tested on hot_dallas: - banner (Python): text + font combo + scrolling output, 12/12 GUI-vs-CLI - bigfind (C++): top-N largest files table, exact CLI match - emptybig (C++): sparse-file finder, exact CLI match on fixture Top-level README indexes all 50 drawn apps; LICENSE is MIT (util_box itself is unlicensed; MIT matches lzply and lightgui). datecalc and certcheck are blocked pending execution-risk approval.
3.5 KiB
banner — util_boxgui
A LightGUI (Python/XFrame) port of the util_box banner CLI utility:
type text, pick a font, and the ASCII banner renders live in the
scrolling output area below.
What it does
- Text entry (top left): the text to render. Pre-filled with
Helloon launch. - Font combo (top right): the four built-in fonts —
standard,small,big,slant.standardis selected on launch. Click the combo to cycle to the next font. - Output area (below, fills the window): the rendered banner in
a monospace font, with scroll bars. The banner for
Helloinstandardis already rendered when the app starts, so a plain launch + screenshot is representative.
Interaction: click the text entry to focus it (blue outline), then type — BackSpace deletes. Changing the text or the font re-renders the banner immediately.
How to run
On hot_dallas (104.225.223.162), from this directory:
PYTHONPATH=/root/lg-review/lightgui_python python3 banner.py
Requires python3-gi / gir1.2-gtk-3.0 and the LightGUI Python checkout
at /root/lg-review/lightgui_python on PYTHONPATH. Under Xvfb:
Xvfb :100 -screen 0 1024x768x24 &
DISPLAY=:100 PYTHONPATH=/root/lg-review/lightgui_python python3 banner.py
The window title is banner - util_boxgui.
How it maps to the CLI
The original is /root/fileutils/bin/banner (util_box):
banner [-f FONT] TEXT... | banner --list-fonts
- Same fonts. The combo lists exactly the CLI's four fonts:
standard,small,big,slant(--list-fontsoutput). - Same rendering. The font table (
FONT), the unknown-character glyph (UNKNOWN), andrender()are vendored verbatim from the CLI script intobanner.py, so the GUI output is byte-identical to the CLI output for the same text and font — verified against the CLI on 12 cases (all four fonts, mixed case, digits, punctuation, spaces, unknown characters such as@, which the CLI renders with theUNKNOWNblock glyph). Lowercase input is upper-cased, exactly as the CLI does. - Same edge cases. Empty text: the CLI errors out
(
give text to render); the GUI instead shows an empty output area (the CLI's rendering of""is five blank lines — the GUI shows the same blank result without the blank lines). Characters with no glyph (e.g.@) render as the CLI's block glyph. - Font effects, as in the CLI:
smallkeeps the top, middle and bottom rows;bigdoubles every character horizontally and vertically (10 rows);slantindents each successive row one space further right.
One deliberate difference: the CLI prints to stdout; the GUI shows the banner in the output area and never writes to stdout.
Known limitations
- LightGUI draws its widgets with Cairo on a single
Gtk.DrawingArea— there is no native GTK keyboard focus or combo drop-down. This app wires focus and typing itself (click the entry, then type) and the font combo cycles through the four fonts on click instead of opening a drop-down list. - The output area does not really scroll: LightGUI's text-view scroll
bars are drawn, not functional. A very wide banner (long text in the
bigfont) is clipped at the right edge with an ellipsis. The defaultHellofits in every font;util_boxguifits instandard,smallandslant, but is clipped inbig.
Walkthrough
Planned walkthrough article (to be published on hot_newyork):
