Is it possible to call an RetroPie-Setup scriptmodule from command line?
-
@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?
-
@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 mentionedretropie_setup.sh
sets up. -
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% </dev/tty >/dev/tty</command>
What I did:
- created an empty file with the same name of the script module, but with
.rp
extension (not.sh
) in~/RetroPie/retropiemenu/
directory. - restarted emulationstation.
- 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! ;-)
- created an empty file with the same name of the script module, but with
-
@meleu Ah cool! Glad you figured it out! Might wanna fiddle with this myself.
-
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 thegamelist.xml
and manually added entries for my scripts. I put this alteredgamelist.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.
-
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?"
-
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. -
@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!
-
@BuZz
I triedsudo ./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 issudo ./retropie_packages.sh setup updatescript
. I tried and it worked![No questions this time. Only posting this trick for future reference.]
-
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.
-
@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....) -
@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?
-
@meleu not without some code refactoring.
-
@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) -
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?
-
@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
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.