SWARM = Shell Wrapper and Runtime Modifier
But as a matter of fact, it's more like a Text User Interface framework for scripts.
Which was the original title (TUI) of the first split-up iteration from Script-Tools.
Script-Tools is still the 'end/final-project', SWARM is just the way to get there.
And for that project - Script Tools - I'd like to ask to cooperate with others, once SWARM is stable that is.
I've had it (Script-Tools) working with things like: st tweak grub 2 theme
or st dev ssh con
or even st set lm gdm rndbg
As you see by the command syntax, it has several sub section, all of which are directories containing directories and files which can be called and arguments/options passed to.
This (functionality of SWARM) allows one to 'sort' one's script into directories and still be able to call them directly.
I belive this is something alot of us want.
Further, I love the console, it's very powerfull, but... also boring in it's appearance.
There's alot of unused space as everything is left oriented, SWARM offers you to output text left, center or right oriented.
And even better yet, it allows for 2 different 'liners' called 'header' and 'title' which bring some (theme'able) colors and designs to the regular terminal.
SWARM also offers 'handlers' for browsers and editors (and more), for both, CLI and GUI applications alike.
So you, as a script author/writer dont have to worry which text editor an enduser has installed.
Further it simplifies repeative tasks like yes/no question and status information wether or not a task has been successfully executed (yesno "question", status $? "text").
So, in an all short saying:
SWARM allows you to easy write application-like scripts.
A comment from a GNU guy i've sent TUI/SWARM to review, sorry lost the email and dont recall the name:
"A very new approach to the console!
For general feedback, please refer this specific thread:
Feedback wanted for upcoming script language
But of course if we can keep it short, you're welcome to post here too, but I dont want hughe discussions in this thread.
If this sounds interesting to you so far, and if you want to know what kind of challenges I'll be facing, stay tuned
But a warning, I've completed all tasks already, what I need to do now is to restructure and rewrite/adjust the code for the new projectname SWARM (runtime only, no install required anymore).
What I want to do in/with this thread:
* Write my 'todays goal'
* Write how it went, because it's been 5 years when I last 'viewed' my code.
* This is to push myself, because redoing what you've already done is.. annoying...
--- Post updated at 19:31 ---
Yesterday I finaly completed the basic loading procedure.
Had an issue with traps, due to blindly copy-paste code without considering from where I copied (a file generating script, thus some variables were escaped, which obviously didnt work in an executed/sourced file).
Traps aside, the Theme procedure works now, at least the Theme-Array contained the required data.
And I learned something new.
If you want to fill a variable/array from a function for the main script, use declare -G varname[=value]
Also some other interesting point, the main reasons I initial had decided to go for an installation was that not all Distro's support "COLUMNS" or "LINES", thus when setting those variables per call, they wouldnt update in a runtime only apporach, but when beeing single files each call will have the updated values, so the aligment of the output is according to the terminal windows dimensions (if called in a GUI).
Now, I do have some more experiences, so it wasnt a problem to simply make it a subshell (is that the proper word?) which will reset those 2 values and export them to the mainscript.
Heck, I've even gave it an option to set the intervall.
Writing this reminds me of something, this value should be 'set'able' from the outside so a script can define how fast the values COLUMS and LINES are beeing updated.
Maybe even a check wether we're in GUI or not.. as for a console (TTY) only, those values wont change, so the intervall could be disabled alltogether...
(this is precicly why I wanted a blog, writing about something helps to find new things, and share new discoveries/learned things)
So much for yesterday.
Today I want to get swarm.print.border
done (all swarm.* functions are for internal use only, bash'ism), maybe even the basic printl
But boy.... thats 500 lines of code (1 function) to review and adjust, wish me luck