Jump to content

schwar3kat

Moderators
  • Posts

    241
  • Joined

  • Last visited

Event Comments posted by schwar3kat

  1. On 12/8/2023 at 10:44 PM, Tearran said:

    @Igor  Pointed out a probable solution to the concept, Basic consept logic https://github.com/armbian/configng/blob/main/bin/armbian-configng#L25  

     
    @Tearran Bear in mind I'm not experienced with bash, so expect some ignorance 😄

    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)
     

    # @description Do something useless.
    #
    # @exitcode 0  If successful.
    #
    # @options none
    
    # menu_init function triggered first by menu creation routines if it exists
    function menu_init(){
        #
        # Only display menu option if internet connection is available
        #
        wget -q -t 1 --timeout=5 --spider http://github.com
        if [[ $? -ne 0 ]]; then
            menu_item=false
        else
            menu_item=true
        fi
    
        menu_text='Do something useful' # this could override the description as the menu text if it exists
    }
    
    function group::string() {s
        echo "Doing something"
        return 0
    }

     

  2. 7 hours ago, Igor said:

    I watched this week's video, and have a question about Joey's configng presentation.
     

    If my understanding is correct then the directory/folder that contains the script function determines the menu group, and the script header description determines the menu item wording.

    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?

  3. I will be sleeping while you meet but I'm quite keen to see development related topics move to GitHub.
    Perhaps along with setting the board bring up forum to read-only,  a pinned post with instructions could be left.
    The topic/header on #armbian IRC could also perhaps be leveraged in some way.

    I have an idea that I'd like to table for discussion around providing developers with a simple consistent way to configure default sys-triggered LEDs in Armbian build.  It might be distracting during a release rush though, but doing it on Github would be good.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines