Giter Site home page Giter Site logo

Comments (2)

MichaIng avatar MichaIng commented on July 20, 2024

Many thanks for your suggestion.

Generally I like the idea of custom scenes, especially since this implies some generic way of defining and loading scenes. This however means also some infrastructural rework of the script, to combine all functions and variables which belong to a script in a way which allows to add more, likely an array. Ah, basically what you say already. Whether the array(s) are then extended with a single file, or multiple files within a directory, should not matter much. The latter would allow easier extension. But please do not use the dietpi user's home dir, as this user will go eventually. Instead I suggest /var/lib/dietpi/cloudshell/scenes/ and/or even something on user basis, like ~/.config/dietpi-cloudshell/scenes.

But while this would be awesome, if a DietPi-VPN/OpenVPN scene is wanted short-/midterm, a hardcoded additional scene is much easier to implement. A DietPi-VPN scene would be a logical extension, as we have an optional login banner entry for it as well, and some status function in the dietpi-vpn script. This could be extended to return some more information for the multiple available lines in a cloudshell scene: https://github.com/MichaIng/DietPi/blob/a27f012/dietpi/func/dietpi-banner#L248

from dietpi.

roelbroersma avatar roelbroersma commented on July 20, 2024

Exactly, you get the idea!

An openvpn script could also be mader after a split-up of the cloudshell in separate scene files. Let's save us that small part ;)
I think when splitting up the cloudshell, so it would be easier to implement new scenes, will give Cloudshell a serious boost. People will probable add scenes for specific daemons or network-bridging, etc.

If there is anything I could do, let me know. You probably have a better idea on this, how to separate scenes from the (1 file): https://github.com/MichaIng/DietPi/blob/master/dietpi/dietpi-cloudshell

  • Probably, making the aEnabledScenes[] a variable which is loaded from the settings file?
  • Create a new array which maps scene_numbers to scene_function_names, e.g: customScenes[11]="myFunction".
  • During the loop of aEnabledScenes, check if there are more than 10 scenes. if so, load the functions files (.sh) from /etc/dietpi/cloudshell/scenes/ (function files as in the customScenes array).
  • Call the function, loaded from the file, by it's name as in the customeScenes array.

In this way, we first make an extension to cloudShell. So we do not put existing scenes in scene files. This way it's more seamless to migrate to the new version we create.

from dietpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.