RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Is it possible to call an RetroPie-Setup scriptmodule from command line?

    Scheduled Pinned Locked Moved Ideas and Development
    retropiemenuemustationscriptmoduleretropie-setup
    18 Posts 6 Posters 14.0k Views
    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.
    • meleuM
      meleu
      last edited by meleu

      [EDIT: changed the topic title to encompass new questions on the same subject.]

      Here is the answer: https://retropie.org.uk/forum/post/18509

      [SOLVED] How to add an RetroPie-Setup scriptmodule in ES RetroPie menu?

      I would like to add a RetroPie-Setup module (let's say the SSelph scraper) directly to the emulationstation's RetroPie menu. Is there a way to achieve it?

      • Useful topics
      • joystick-selection tool
      • rpie-art tool
      • achievements I made
      1 Reply Last reply Reply Quote 0
      • ShakzS
        Shakz
        last edited by

        Can you not just call it from the retropie menu?
        Something like this for example with the scraper....

        cd ~/RetroPie/retropiemenu
        ln -s /home/pi/RetroPie-Setup/scriptmodules/supplementary/scraper.sh Scraper.sh
        

        Then restart....You should see a Scraper script in the Retropie menu now. I have no clue if this will work though as I am at work and sadly far from my pi.

        RetroPie tips, tricks, and tweaks: https://www.youtube.com/eazyhax

        meleuM 1 Reply Last reply Reply Quote 0
        • meleuM
          meleu @Shakz
          last edited by meleu

          @Shakz
          Quite obvious huh? :-)
          But if you look carefully at these scripts you'll see that it's a bunch of bash functions. Only functions. And no "starting point" calling those functions. I think that's why they are used to name it as "modules".

          The retropie_setup.sh makes the magic (shows each module info and let us launch them). But I see some of modules available at RetroPie menu and got curious.

          I think, but I'm not sure, they are there because: 1) the *.rp empty files found in $HOME/RetroPie/retropiemenu/; 2) the /opt/retropie/configs/all/emulationstation/gamelists/retropie/gamelist.xml file has entries for those *.rp files.

          Is it enough to show a module at RetroPie menu?

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          ShakzS 1 Reply Last reply Reply Quote 0
          • ShakzS
            Shakz @meleu
            last edited by

            @meleu
            Well I beleive they are in they are in the gamelist so we get a pretty picture in the menu. We didnt get that with retropie 3.6 unless we created the xml file ourselves.
            I am curious what exactly the .rp scripts are. I assume they are launching the individual functions but also calling all of the variables that you mentioned retropie_setup.sh sets up.

            RetroPie tips, tricks, and tweaks: https://www.youtube.com/eazyhax

            1 Reply Last reply Reply Quote 1
            • meleuM
              meleu
              last edited by meleu

              I've got it!
              The magic happens in /etc/emulationstation/es_systems.cfg, at this line:

                  <command>sudo /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch %ROM% &lt;/dev/tty &gt;/dev/tty</command>
              

              What I did:

              1. created an empty file with the same name of the script module, but with .rp extension (not .sh) in ~/RetroPie/retropiemenu/ directory.
              2. restarted emulationstation.
              3. Done!

              And then I realized that putting the SSelph scraper at RetroPie menu is a bad idea. :-) It can't be executed while emulationstation is running...

              Well, at least I learned how to do it! ;-)

              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              ShakzS 1 Reply Last reply Reply Quote 1
              • ShakzS
                Shakz @meleu
                last edited by

                @meleu Ah cool! Glad you figured it out! Might wanna fiddle with this myself.

                RetroPie tips, tricks, and tweaks: https://www.youtube.com/eazyhax

                1 Reply Last reply Reply Quote 1
                • M
                  MikeDave
                  last edited by

                  I did something similar for my setup. I have a couple of scripts for backing up and restoring save data in the RetroPie menu. All I did was put my game-save-backup.sh, etc. in ~/RetroPie/retropiemenu/ and they showed up properly.

                  I also put an icon in ~/RetroPie/retropiemenu/icons/, then took the gamelist.xml and manually added entries for my scripts. I put this altered gamelist.xml in ~/RetroPie/retropiemenu/ as well and it just worked.

                  I have to restart after running the script that overwrites my save data files so ES will pick up the changes, but other than that it's working great for me.

                  cyperghostC 1 Reply Last reply Reply Quote 1
                  • meleuM
                    meleu
                    last edited by meleu

                    More questions about retropie-setup scriptmodules invoking methods...

                    I'm working on a tool that depends on a new feature added to runcommand (the runcommand-onstart.sh). The tool checks if the runcommand has this feature and alerts the user saying that an update is needed (and give some instructions to do it).

                    Everything is fine and I'm happy with it. But, as matter of curiosity, it brought me some questions:

                    Is it possible to invoke the update/instalation procedure of runcommand from a commandline?

                    If it's possible, is it safe (or can misconfigure something)?

                    It would be cool because allow to ask to the user: "Do you want to update it now?"

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    1 Reply Last reply Reply Quote 0
                    • BuZzB
                      BuZz administrators
                      last edited by

                      sudo ./retropie_packages.sh runcommand install would install runcommand.

                      run sudo ./retropie_packages.sh on it's own for a list of modules / functions. Some functions may show up but may require parameters etc.

                      To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                      meleuM 1 Reply Last reply Reply Quote 1
                      • meleuM
                        meleu @BuZz
                        last edited by

                        @BuZz
                        Really cool!

                        Worked like a charm here. But I noted that it overwrote my tweaked runcommand.sh with no backups.

                        No problems here. I just need to warn the user about it.

                        BTW: Some guys are making cool stuff with tweaked runcommands (example: https://retropie.org.uk/forum/topic/3134/meet-the-retrog). And that runcommand-on{start|end} can avoid the need of tweaking runcommand directly.

                        Thanks a lot!

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        1 Reply Last reply Reply Quote 0
                        • meleuM
                          meleu
                          last edited by meleu

                          @BuZz
                          I tried sudo ./retropie_packages.sh runcommand install to get your recent changes to runcommand but it didn't work as expected. Then I updated RetroPie-Setup script and tried to update runcommand from command line again. This time it worked perfectly. Probably it's a git thing...

                          Maybe it's better to update retropie-setup script before update runcommand from command line.

                          Looking to the output sudo ./retropie_packages.sh, I inferred that the command to update retropie-setup is sudo ./retropie_packages.sh setup updatescript. I tried and it worked!

                          [No questions this time. Only posting this trick for future reference.]

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          1 Reply Last reply Reply Quote 0
                          • BuZzB
                            BuZz administrators
                            last edited by

                            if you didn't update retropie-setup then you don't have the latest changes - so runcommand will re-install the current version.

                            That will update the script, but it's not the same as doing the update through the gui. You would also need to call post_update. I would recommend using the gui unless you are ok with debugging problems yourself etc.

                            To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                            meleuM 1 Reply Last reply Reply Quote 1
                            • cyperghostC
                              cyperghost @MikeDave
                              last edited by

                              @MikeDave
                              Can you please post your Backup/Restore Solution.

                              Maybe I can create a entry that saves
                              "wpa_suppliment.conf", "retroarch.cfg" and the BT-settings for each controller.
                              It will be backuped to FAT32 partition and can be restored to RetroPie-system.
                              It's always a bit of work to flash a new image to system and then to enable wifi-connect, restore joypad-settings and perform some scripts (link to rom folder, restore BIOS files, enable root....)

                              1 Reply Last reply Reply Quote 0
                              • meleuM
                                meleu @BuZz
                                last edited by

                                @BuZz
                                [Reposting what I posted here a few weeks ago, but maybe you aren't following that thread anymore. The subject fits in this thread too.]

                                It would be a nice feature if we could access that configedit "Choose a player to adjust" dialog for a specific system directly as a runcommand menu option, to let the user choose joypads right before launching a game.

                                I was thinking in something similar with an -onstart script but I think that a runcommand menu option would be more concise and elegant. Then I was trying to find a way to invoke that configedit dialog directly for a specific system retroarch.cfg, but stumbled on the iniFileEditor complexity.

                                Is there a way to call that dialog directly?

                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                BuZzB 1 Reply Last reply Reply Quote 0
                                • BuZzB
                                  BuZz administrators @meleu
                                  last edited by

                                  @meleu not without some code refactoring.

                                  To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                  meleuM 1 Reply Last reply Reply Quote 1
                                  • meleuM
                                    meleu @BuZz
                                    last edited by

                                    @BuZz I was about to ask if you would accept a PR with a scriptmodule to do the very same task as the _joypad_index_configedit does, with the only reason to make it able to be called by runcommand. But then I realized that, considering that the next release of RetroPie will have an updated RetroArch, the users will be able to change the controllers on-the-fly with RGUI (following the steps I detailed here)

                                    • Useful topics
                                    • joystick-selection tool
                                    • rpie-art tool
                                    • achievements I made
                                    1 Reply Last reply Reply Quote 0
                                    • C
                                      chapas
                                      last edited by

                                      I have related problem, adding this system:

                                      <system>
                                      <name>retropie</name>
                                      <fullname>RetroPie</fullname>
                                      <path>~/RetroPie/retropiemenu</path>
                                      <extension>.rp .sh</extension>
                                      <command>sudo /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch %ROM% </dev/tty >/dev/tty</command>
                                      <platform>retropie</platform>
                                      <theme>retropie</theme>
                                      <directlaunch/>
                                      </system>

                                      on es_systems.cfg is crashing emulationstation.

                                      Permission problems?

                                      BuZzB 1 Reply Last reply Reply Quote 0
                                      • BuZzB
                                        BuZz administrators @chapas
                                        last edited by BuZz

                                        @chapas It's not related - please open a new topic (even if you have the same problem, it's not helpful to post to the end of an old topic)

                                        also

                                        Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

                                        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

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

                                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.