Hi all!
I've created a small printing framework based on the "eips" utility in the Kindle. It's written as a shell script which you can source and use its functions.
Features:- prints on the screen
- auto new-lineing
- auto scrolling
- small formatting utility
- you can print "-i" on the screen with it! (try it with eips... no good)
Limitations:
This tool is limited by eips, so:
- certain characters are replaced by similar ones / totally OT ones
- the "\" character is not replaced (stupid shell.. don't know why
)
Function list:- mp_reset -> resets screen+options
- print <text> -> prints text with no newline at the end
- printn <text> -> prints text with newline at the end
- pcenter <text> -> prints text centered on the line
- psetpos <x> <y> -> sets cursor position on the screen
- pback -> moves back one character on the line
- pbackf -> erases character under cursor and moves back one character on the line
- pbackline -> if the X cursor position is zero, moves to previous line, else sets x=0
- pbacklinef -> like pbackline + erases line
- pscroll <num> [from] -> scrolls num lines (if from is set, skips from lines from the up)
- pprintf <text> -> prints text with formatting
- pprintfn <text> -> like pprintf but with the newline at the end
The last two options allow you to print some program output to the screen like this:
which prints dir listing to the screen.
Configurables: (enabled means set to 1)
- mp_h -> if enabled, text is printed out highlighted
- mp_scroll -> sets num lines to autoscroll;0=erase entire screen
- mp_scroll_from -> num of lines which won't be erased when scrolling/erasing (from up)
Download:
http://jailbreak-kt.tk/bin/pfw
How to use:
Code:
source /path/to/pfw
# it will init automatically
printn "Hello world!"
This one started as screen printing helper in web jailbreak, but I decided it would be good to refine it and share. Hope my effort was useful!