-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we include/exclude a script in the menu based on a runtime condition - discuss options. #26
Comments
For directories/folders creating menu groups, any folder could perhaps have an initialization script with a defined name, maybe menu_group_init. This could contain a function similar to the function in the scripts.
|
@schwar3kat Thank you. The example you share addresses a few with Header issues I had for 1. and I fully agree with your suggestion regarding the implementation of a "standard initialization function", And has a intended location. However, I want to emphasize the paramount importance of establishing a clear responsibility framework upfront. In our bash scripting environment: Frontend: Comprises bash scripts responsible for user interactions and tasks related to the interface. /bin Backend: Encompasses bash scripts managing server-side logic, data processing, and other backend functionalities. subfolders of the library dynamically can delete or create files and folders without effecting of the frontend. Communication Layer: Involves custom bash scripts or functions facilitating communication between the Frontend and Backend. Think of it as an interface, akin to an API but tailored to our bash scripting environment. root of library For example, within the Frontend, bash scripts may trigger specific Backend functionalities and receive responses, possibly by invoking Backend scripts or functions. The Communication Layer ensures a structured and standardized way for these components to exchange data and instructions. initially is in the root of the library these curranty require editing the frontend at the stage. Focusing on this responsibility framework creates an environment where new contributors can quickly understand and engage with the project. I believe that this structured approach will not only benefit the current development process but will also make it much easier for others to collaborate and contribute effectively. |
For dynamic runtime menu text, default text and dialogue text, how could we/should we include multiple languages? Maybe json key value pair file: (Idea from https://www.honeybadger.io/blog/creating-multi-language-user-interface-with-react/) en/translation.json (For English): { fr/translation.json (For French): { es/translation.json (For Spanish): { |
From my understanding of the existing bash-utility-master in the project was intended for such things. note: configng has no systems requirements beyond gnu bash tools Separating function requirement from configng requirement are of high importance. A requirements list in the header could be leveraged to provide a list of requirements, that can then be used for available list used for triggers. such as menu items show/hide
to make an array that will work something like
With bash-utility-master
With GNU bash
|
I can see that this could be the basis for a binary toggle, but would be better if it was constructed to handle any number of item's in a list, rather than just two. How could a menu item be renamed based on the results of a function during menu initialization? |
include/exclude a script from the menu based on a runtime condition has be solved with jq and json object |
How can we include/exclude a script in the menu based on a runtime condition, like it is possible in armbian config? E.g. depending on a file or executable existing.
How can we include/exclude a script group in the menu based on a runtime condition like it is possible in armbian config?
Perhaps some kind of standard initialization function if it exists, could be triggered first as each script is parsed, setting initialization variables could be included as a standard part of any function script. And a similar menu folder initialization script could be included in any folder.
One of those variables could set visibility. Another could set menu text, allowing dynamic menu text based on runtime requirements and possibly other options could be added if required.
Any logic could be used to set those variables.
To illustrate with an example of what I am imagining. Maybe something like this:
(excuse my bash if it is bad or not feasible)
The text was updated successfully, but these errors were encountered: