How to add an entry in UI to run a custom script
-
@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
-
@voljega Thanks for the advice! I will try it out
-
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.
-
@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
-
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:XXworks for me. Again thanks for your help
-
@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?
-
unfortunately that doesnt work.
The original moonlight command interferes with it. There %ROM% is just a parameter.%ROM% as standalone works.
-
@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
-
Ah, now i know what you mean.
Yeah sorry, it was late yesterday. I need more sleep. -
@zemus no prob