Sorry and thank you.
I was sick for a week and had troubles with several services i didnt want to solve until i was healthy again.. medics-brain and such combinations...
This must have 'passed' my 'awarness' today, but my system is working again.
While i will apply your suggestions (its 4am atm, so it'll be after sleep & understanding them), i can say already, it'll remain in just that script, as the display must (also) match (possible changing) GUI terminal lengths...
If it'd be a 'pre-loaded' env variable, it'll always be either the max lenght, or the lenght of the terminal window upon call, but never ever be the matching length once the terminal window was (if/when) resized once or more times.
Of which i fail to see/provide the requirements if i'd place it in /etc/prfile.d/tui.sh, eventhough i see the performance bonus by ITSELF , it looses its USAGE bonus overall... -> thus the
-z $VAR, which i thought to be the fastest check...
-->
Quote:
Originally Posted by
Chubler_XL
Please consider making tui-printf a function definition in this file and sourcing it in any client code, as this is a recursive routine and called many times from each client, you will benefit from not loading a new shell each time it is used.
Not really understanding... are you saying, sourcing an additional script, just containing the ($WIDTH) code, is faster than leaving the code in the file that is actualy executed?
Keep in mind, tui-echo, tui-header, tui-title, tui-status, etc, are ALL calling --just-- tui-printf, making that 'application-script' sourcing an addition file, makes the complete procedure (mechanicly) slower, or am i wrong?
Maybe the two lines are just one, its late.
EDIT5orso...
I've have had a function called printx provided in the script '/bin/tui' which was sourced instead of /etc/profile.d/tui.sh, but in combination with the other things, specialy using that function for its main prupsose.. printf... was slower than it is now.
Since tui-rpintf required tui to be source, so the function was available, this way around, tui-printf IS the function, available right from the terminal, rather than having to source something first.
Please correct me if i'm 'wrong', that was just my testet (1-3x) experience.
EDIT 6 -- PPS-Notes:
/etc/profile.d/tui.sh: Provides only 'hard-coded' and for reusage defined variables.
$WIDTH is very flexible on its definition, that is absolute true in GUI mode with one or more terminal-windows open that may or may not be on the same screen, and due to the GUI be resized to the pleasure/need of the user.
EDIT for Don:
Sorry, seems one of my Firefox addins/plugins scratches that display functionality...