@minze there no way you're in the right folder when launching the script so either try to use the absolute path or move to it before launching it
Solved Syncing saves
-
@idarius Thanks, Im giving a look at it.
-
I have been able to sync saves to google drive thanks to rclone, which uses rsync. now what I need is to know how to activate an script everytime a game is closed
-
@minze you should add a command launch in python script emulatorlauncher.py
-
@voljega Yeah, I figured out at midnight, the thing is that right now I think that I wasn't able to execute-it.
this is my code for the .sh:#!/bin/bash rclone sync gdmedia:rpi /recalbox/share/saves/ echo finished and this is for my emulatorlauncher.py
[...] def main(args): subprocess.call('./syncFiles.sh') playersControllers = dict() if not args.demo: [...] what am I doing wrong?
PS: As soon as I fix that I'll make a tutorial, because there is no one yet on how to sync files with drive/dropbox/etc
-
@minze well first your script should be launched after the emulator was launched, you some to launch it before
also I personnaly use os.popen to launch command :
os.popen('cp -R '+whdFilespath+'/* '+mountPointWHDL)
you can also look into utils/runner.py and Command.py for something a little more complicated, but perfectly tweakable.
and keep your modifications backed up because all of that can be erased at each update
-
@voljega Well that was an script to see if it worked because it produces changes easy to see.
And the script should be launched everytime a game is ran right? at least that's what I thought.
Should I modify the script like that?
edit:(I've modified the .sh to have an start argument)if __name__ == '__main__': signal.signal(signal.SIGINT, signal_handler) pa**er = argpa**e.ArgumentPa**er(description='emulator-launcher script') pa**er.add_argument("-p1index", help="player1 controller index", type=int, required=False) pa**er.add_argument("-p1guid", help="player1 controller SDL2 guid", type=str, required=False) pa**er.add_argument("-p1name", help="player1 controller name", type=str, required=False) pa**er.add_argument("-p1devicepath", help="player1 controller device", type=str, required=False) pa**er.add_argument("-p1nbaxes", help="player1 controller number of axes", type=str, required=False) pa**er.add_argument("-p2index", help="player2 controller index", type=int, required=False) pa**er.add_argument("-p2guid", help="player2 controller SDL2 guid", type=str, required=False) pa**er.add_argument("-p2name", help="player2 controller name", type=str, required=False) pa**er.add_argument("-p2devicepath", help="player2 controller device", type=str, required=False) pa**er.add_argument("-p2nbaxes", help="player2 controller number of axes", type=str, required=False) pa**er.add_argument("-p3index", help="player3 controller index", type=int, required=False) pa**er.add_argument("-p3guid", help="player3 controller SDL2 guid", type=str, required=False) pa**er.add_argument("-p3name", help="player3 controller name", type=str, required=False) pa**er.add_argument("-p3devicepath", help="player3 controller device", type=str, required=False) pa**er.add_argument("-p3nbaxes", help="player3 controller number of axes", type=str, required=False) pa**er.add_argument("-p4index", help="player4 controller index", type=int, required=False) pa**er.add_argument("-p4guid", help="player4 controller SDL2 guid", type=str, required=False) pa**er.add_argument("-p4name", help="player4 controller name", type=str, required=False) pa**er.add_argument("-p4devicepath", help="player4 controller device", type=str, required=False) pa**er.add_argument("-p4nbaxes", help="player4 controller number of axes", type=str, required=False) pa**er.add_argument("-p5index", help="player5 controller index", type=int, required=False) pa**er.add_argument("-p5guid", help="player5 controller SDL2 guid", type=str, required=False) pa**er.add_argument("-p5name", help="player5 controller name", type=str, required=False) pa**er.add_argument("-p5devicepath", help="player5 controller device", type=str, required=False) pa**er.add_argument("-p5nbaxes", help="player5 controller number of axes", type=str, required=False) pa**er.add_argument("-system", help="select the system to launch", type=str, required=True) pa**er.add_argument("-rom", help="rom absolute path", type=str, required=True) pa**er.add_argument("-emulator", help="force emulator", type=str, required=False) pa**er.add_argument("-core", help="force emulator core", type=str, required=False) pa**er.add_argument("-ratio", help="force game ratio", type=str, required=False) pa**er.add_argument("-demo", help="mode demo", type=bool, required=False) pa**er.add_argument("-netplay", help="host/client", type=str, required=False) args = pa**er.pa**e_args() command = './syncFiles.sh start' os.popen(command) exitcode = main(args) time.sleep(1) exit(exitcode) -
@minze there no way you're in the right folder when launching the script so either try to use the absolute path or move to it before launching it
-
@voljega Ooh, I thought that as I that script was in the same folder that the py, I could use that, yeah it makes sense that it doesn't make sense. Thanks
i'll try it as soon as I arrive home.
-
Cool hope it works
@minze said in Syncing saves:
PS: As soon as I fix that I'll make a tutorial, because there is no one yet on how to sync files with drive/dropbox/etc
You can also work on official integration, because this is a feature that users regularly ask for
-
@voljega Yeah, I'll take a look at it too
-
@minze your script is anyway launched before the emulator, i thought you wanted it right after ?
-
@substring Yeah I want to execute the script:
- On start, once wifi is enabled.
- When any game is launched.
- if possible, when any game is closed