Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    How to add an entry in UI to run a custom script

    Recalbox General
    entry run script
    3
    11
    1107
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Zemus
      Zemus last edited by

      Hi,

      At this time i didnt found an answer for this problem:

      Now that i can use Wake on Lan with the "ether-wake" command i want to add an entry for it in the moonlight section. My first guess was try to edit the gamelist.xml in the moonlight folder, but i guess the pa**er is too specific to let an sh-script through.

      Another solution could be a seperate Entry in the main menue if this is possible.

      I would be grateful for any suggestion

      voljega 1 Reply Last reply Reply Quote 0
      • voljega
        voljega Banned @Zemus last edited by

        @zemus you can help yourself with the readme for my randomizer script here, should give you most of the step : https://github.com/Voljega/scripts4recalbox/tree/master/Randomizer

        just adapt everything a little bit and replace the <command> tag content by your sh command

        Zemus 2 Replies Last reply Reply Quote 1
        • Zemus
          Zemus @voljega last edited by

          @voljega Thanks for the advice! I will try it out 🙂

          1 Reply Last reply Reply Quote 0
          • Zemus
            Zemus @voljega last edited by

            @voljega

            But as far i can see, this will create a whole new systemchart. For one script only it seems a bit overkill. But i will see it later at home.

            voljega 1 Reply Last reply Reply Quote 0
            • voljega
              voljega Banned @Zemus last edited by voljega

              @zemus you can't do it any other way for now, or you can but it's a bit more complicated

              You'd need to add a script command called by moonlight system and then check if you are launching your sh or another thing, and redirect to the standard moonlight command if needed or do your things if it is your wake up sh script

              Anyway you can do what you want really but at least these few steps will give you some hints on how to do it

              Actually for this more evolved thing if you are not afraid of python you can look at my randomizer script it does a little bit of that

              Zemus 1 Reply Last reply Reply Quote 0
              • Zemus
                Zemus @voljega last edited by Zemus

                @voljega

                After ive got through your readme, the answer was pretty obvious:

                add a new system in /recalbox/share_init/system/.emulationstation/es_systems.cfg like this:

                <system>
                <fullname>Scripts</fullname>
                <name>Scripts</name>
                <path>/recalbox/share/roms/scripts</path>
                <extension>.sh</extension>
                <command>%ROM%</command>
                <theme>Scripts</theme>
                <platform>Scripts</platform>
                <emulators/>
                </system>

                and put your .sh scripts in /recalbox/share/roms/scripts

                for example wakeonlan.sh:

                ether-wake -i wlan0 XX:XX:XX:XX:XX
                ether-wake -i eth0 XX:XX:XX:XX:XX

                works for me. Again thanks for your help 🙂

                paradadf 1 Reply Last reply Reply Quote 1
                • paradadf
                  paradadf Staff @Zemus last edited by

                  @zemus if you just add the .sh extension to the moonlight es_systems.cfg, wouldn’t it be enough? Maybe chmod'ing the script itself before?

                  If your question was answered, please mark it as solved: Topic Tools -> Ask a question + Topic Tools -> Mark as Solved

                  Zemus 1 Reply Last reply Reply Quote 0
                  • Zemus
                    Zemus @paradadf last edited by

                    @paradadf

                    unfortunately that doesnt work.
                    The original moonlight command interferes with it. There %ROM% is just a parameter.

                    %ROM% as standalone works.

                    voljega 1 Reply Last reply Reply Quote 0
                    • voljega
                      voljega Banned @Zemus last edited by voljega

                      @zemus yeah that's what I said that :
                      "You'd need to add a script command called by moonlight system and then check if you are launching your sh or another thing, and redirect to the standard moonlight command if needed or do your things if it is your wake up sh script"

                      if you want to integrate it to moonlight system, that is

                      Zemus 1 Reply Last reply Reply Quote 0
                      • Zemus
                        Zemus @voljega last edited by

                        @voljega

                        Ah, now i know what you mean.
                        Yeah sorry, it was late yesterday. I need more sleep.

                        voljega 1 Reply Last reply Reply Quote 0
                        • voljega
                          voljega Banned @Zemus last edited by

                          @zemus no prob 🙂

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          Want to support us ?

                          60
                          Online

                          90.3k
                          Users

                          26.3k
                          Topics

                          181.7k
                          Posts

                          Copyright © 2021 recalbox.com