Commit Graph

7 Commits (a7d5b9d1bcc9524bd2fc08a09db4ac6d9229af7e)

Author SHA1 Message Date
Amir Alexander Abdelbaki a7d5b9d1bc fix: use measured page capacity instead of derived CPI/LPI geometry
Real-world testing (pagetest.sh) showed the printer's actual per-page
line/column capacity didn't match what the A4-geometry math predicted,
and the redundant blank second page was traced to the printer
auto-advancing to a new page once content hits the bottom margin,
with our own unconditional trailing form-feed then ejecting that
already-started blank page on top of it.

Replace PRINTER_CPI/PRINTER_LPI with directly-measured
PRINTER_MAX_LINES/PRINTER_MAX_COLS in printer.conf (read via
pagetest.sh), and have txt2printr.sh skip the trailing form-feed
whenever the print job already reaches that line capacity.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 09:59:06 +02:00
Amir Alexander Abdelbaki 07cf695840 feat: add PRINTER_A4 landscape option for A4 printers
Dot-matrix printers have no hardware page-rotation, so when PRINTER_A4
is enabled in the new printer.conf, txt2printr.sh rotates the ascii art
90 degrees in software before sending it, and photobooth.py caps its
live-preview viewfinder to an A4-landscape character grid (sized from
configurable PRINTER_CPI/PRINTER_LPI) instead of just filling the
terminal, so the preview matches what actually gets printed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 09:27:22 +02:00
Amir Alexander Abdelbaki 9d6fa2833f fix: correct malformed shebang in txt2printr.sh
Missing '!' meant the kernel couldn't recognize the interpreter
directive, causing ENOEXEC (errno 8) when executed directly, e.g.
via subprocess.run() from photobooth.py.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 09:10:59 +02:00
Amir Alexander Abdelbaki 9019cf2fa7 fix: correct printer device priority fallback in txt2printr.sh
-f only matches regular files, so it never matched the /dev/lp0 or
/dev/usb/lp0 character device nodes, leaving dev unset and always
failing. Use -e existence checks in proper if/elif priority order
(lp0 > usb/lp0 > stdout), with PRINTER_DEV as an unconditional override.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 09:03:47 +02:00
Amir Alexander Abdelbaki c89e1e01ac added more options for printers - if none fount it should output to stdout 2026-07-14 08:57:56 +02:00
Amir Alexander Abdelbaki 5b631adfe4 implement txt2printr.sh to send ascii art to a parallel port needle printer
writes raw bytes to /dev/lp0 (overridable via PRINTER_DEV): resets the
printer with ESC @, converts LF to CRLF to avoid staircasing on raw
device writes, then form-feeds to eject the page.
2026-07-03 10:49:27 +02:00
Amir Alexander Abdelbaki 7030454075 switched exec-cycle to a live >=2fps ascii preview loop and added txt2printr stub
replaced the guvcview+keypress capture flow with a continuous
capture/convert/display loop so the terminal shows a live ascii
preview; pressing c saves the frame and triggers the new
txt2printr.sh hook (currently a blank template).
2026-07-03 10:24:35 +02:00