SNApP (System Nonsuch ApP)

Moderator: Forum moderators

User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

Setting up the pages for printing is a bit hit and miss. One must use print preview to see if further adjustments are needed. Choosing font type and size, along with line length (columns or character page width) and page length (number of lines) ultimately decides how things will appear on the page. So controlling width and length of the printout is the more useful thing, After some experiments I can now control page width, page length and font.... these settings will be saved in /root/.config/snapp/settings/print-${width}x${length}-$(date +%d%h%s).conf for easy reuse. But the basic settings will be for 80 chars wide, 4 spaces left margin, and four lines top and bottom margins. The bottom footer was acheived by using split command, sed line insertion of 'page break line-feeds' at line 68 (12 size font, 80 columns), and cat to rebuild split files for the print preview. None of this processing affects file or viewer contents. All of these settings can be user set using gui fields. However I do realize that the multi-usage of various fields is getting complicated and complex. I have thought about this and in the back of my mind I have the idea of a quick settings control panel to use alongside the main gui, which with one click sets up the various form fields for the different tasks provided by functions and or keywords.

Yad print preview is pinch to zoom enabled. but only one page viewed at a time!!

Attachments
xscreenshot-20240824T161935.png
xscreenshot-20240824T161935.png (14.81 KiB) Viewed 1170 times
xscreenshot-20240824T161324.png
xscreenshot-20240824T161324.png (94.51 KiB) Viewed 1170 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

Print now works by selecting one of three keywords
1. PRINT_VIEWER - wysiwyp (what you see is what you print).
2. PRINT_DOCS - file with path in Docs. field.
3. PRINT_SELECTED - any cursor selected text from anywhere.
After pressing action a list of print.conf files opens for selection. Selecting an item opens a preview of the three variables stored
1. SCALE=80 - line width in chars
2. SPL=68 - page length in lines
3. FONTNAME="Manthesy 20" - font
This preview is editable and saves in place. The list gui also has a button to select a different font, this will override the font in the preview config, no need to edit that. Press ok to continue to the printer dialogue. Here you print or preview. In fact selecting print opens the preview first anyway, Then select print again to complete printing.

Attachments
xscreenshot-20240826T200309.png
xscreenshot-20240826T200309.png (186.82 KiB) Viewed 1108 times
xscreenshot-20240826T194908.png
xscreenshot-20240826T194908.png (49.85 KiB) Viewed 1108 times
xscreenshot-20240826T194808.png
xscreenshot-20240826T194808.png (289.85 KiB) Viewed 1108 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

Another formatting option. When there are very long lines that you tab, they then wrap to the beginning of the next line, but you want them to continue beneath the already tabbed text. The steps needed are first to fold text at desired character length, then tab all lines. This is now a sub-keyword 'ftabs' in the TEXT_FORMAT keyword group. However I was not able to replace the original lines in place, the best I could come up with, is to copy the results to the clipboard, then one must paste them in place.

Added an online ruler. It measures characters on screen according to dpi and font.

Attachments
xscreenshot-20240827T200449.png
xscreenshot-20240827T200449.png (113.38 KiB) Viewed 1069 times
xscreenshot-20240827T193441.png
xscreenshot-20240827T193441.png (320.14 KiB) Viewed 1069 times
xscreenshot-20240827T164738.png
xscreenshot-20240827T164738.png (272.93 KiB) Viewed 1085 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

Here is the code for the onscreen re-scalable yad character ruler! Simply move to the app you are typing in and to calibrate the ruler type in 30 characters and resize the ruler to match 30 on its scale with the 30 on the screen. Then the ruler will be calibrated for the resolution, dpi, scaling, and font size, regardless of the font used in the yad --scale gui.

If you want it to measure pixels you can get the screen resolution from xrandr, for min and max values and set the gui geometry accordingly .... then using two such yad --scale guis one vertical one horizontal you can accurately output any line length / positions in pixels just by moving the scale sliders into position as --scale has --print-partial which continuously outputs to stdout.

Code: Select all

yad --scale --mark="1:1" --mark="10:10" --mark="20:20" --mark="30:30" --mark="40:40" --mark="50:50" --mark="60:60" --mark="70:70" --mark="80:80" --mark="90:90" --mark="100:100"  --step=1 --enforce-step --min-value=0 --print-partial --value=80 --max-value=100 --undecorated --geometry=1541x14+512+1163 --no-buttons --fontname="Serif 12" --hide-value --back="#E8E8E700" --title="character ruler" &
Attachments
xscreenshot-20240829T203413.png
xscreenshot-20240829T203413.png (9.26 KiB) Viewed 1024 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

Having renamed transtext to hashtext along with document suffixes, I made the function backwards compatible and also forwards compatible. The first location for transtext files was /root/.config/snap/transtext, in the case where this directory was updated to hashtext but no transtext files were copied or renamed, and then /usr/share/locale/transtext was used for system-wide convenience, and finally to /usr/share/locale/hashtext ... so the function now searches all locations and if found copies to the final location, and saves new translations in the final location. Or the user can move directories manually to the final location.

cmndlst - and securefn : the password security system now has been implemented for keywords and some possibly destructive functions, SAVE DELETE install_mbr SAVEFILE REMASTER SWAPFILE SAVE_BOOK etc have entries in cmndlst. Each can have a unique password or group passwords or be removed from cmndlst.

Attachments
xscreenshot-20240830T152805.png
xscreenshot-20240830T152805.png (306.15 KiB) Viewed 967 times
xscreenshot-20240830T104234.png
xscreenshot-20240830T104234.png (25.8 KiB) Viewed 988 times
xscreenshot-20240830T105908.png
xscreenshot-20240830T105908.png (29.57 KiB) Viewed 988 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

FORMAT_TEXT:
RICH
PIPE
Added. RICH let's user specify rich-cli command in Docs. field e.g. "rich --panel ascii -R"
PIPE let's user specify pipe command string.

rich-cli can be installed using python

Code: Select all

pip install rich

OCRmyPDF is also availbale using pip. Also does what Tesseract OCR does.

I am now trying to implement some xdotool commands to keep scrollbar in place during Viewer update.

Attachments
xscreenshot-20240901T104553.png
xscreenshot-20240901T104553.png (250.45 KiB) Viewed 900 times
xscreenshot-20240901T104639.png
xscreenshot-20240901T104639.png (359.85 KiB) Viewed 900 times
xscreenshot-20240901T104710.png
xscreenshot-20240901T104710.png (358.21 KiB) Viewed 900 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

More text formatting in the form of columns. While I was copying tetragrams from a pdf the right hand entries pasted to the first column followed by the second column ... no longer side by side. So to enable formatting such text easily I copied the latter text and pasted to a.txt then selected the former text and pased to b.txt, this then displayed the text in tab separated columns. Then I used another function to replace tabs with a space. So to do the same just select some text in viewer, and under TEXT_FORMAT, in BSSID field select cola, click Action, repeat for colb, and 'FORMAT_TEXT' in SSID field, ten click Action button. Side by Side collated text appears in Viewer. To add more columns, select Viewer text and repeat cola, and new text for colb (this will be the third column).... and so on and so forth.

Attachments
xscreenshot-20240907T161916.png
xscreenshot-20240907T161916.png (93.18 KiB) Viewed 170 times
User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

huh.... touch-screen and trackpad rotations were still using fixed values, which should have been variables.....sorted out now.

User avatar
stemsee
Posts: 726
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 177 times
Been thanked: 117 times

Re: SNApP (System Nonsuch ApP)

Post by stemsee »

snapp-5.2 is finally ready ... enough!

Many improvements and additions!

RULERS v ruler ... keyword RULERS puts cross hairs scales on screen for measuring characters, from -30 - 0 + 106. (TEXT_FORMAT) ruler lets you paste a ruler into a document. pixel_ruler (function) is a function similar to RULERS but gets screen dimensions in pixels.

TEXT_FORMAT
cola, colb, colc, cold -> tcolumns (tabs) or scolumns (spaces).

rip ... (replace in pattern) Like SEARCH_N_REPLACE but only for selected text. select text with cursor and then in Identity field put string to be replaced or regex expression .... in DOCS put replacement term or nothing ... press ACTION.

pipe ... like rip but for all text in viewer.

cli ... executable string for in place editing ... '$DOCS /tmp/MO > /tmp/MOD' ... DOCS='rich 'options' /tmp/MO > /tmp/MOD" ' etc

cmndlst (command password list) ... the first group are just cli tray 'run' commands and can be added to .... the others are for functions and keywords .... just change or remove the passwords as desired.
'rm:nogo
mv:nogo
delete:nogo
sh:nogo
shred:nogo
touch:nogo
chmod:nogo
chown:nogo
cp:nogo
eval:nobody
exec:nobody

savetext:tsv
booksave:bsv

remaster:create
swapfile:create
bookgen:create
hashed:create

connect:anybody
disconnect:nobody
execute:nobody
evaluate:nobody
kblayout:nobody
set_cpu:nobody
install:nobody
system:nobody
scene:nobody
player:nobody
network:nobody
bindings:nobody'

Attachments
xscreenshot-20240922T150752.png
xscreenshot-20240922T150752.png (296.54 KiB) Viewed 49 times
Post Reply

Return to “Network”