Open AsherGlick opened 3 years ago
coming from https://github.com/AsherGlick/Burrito/issues/33#issuecomment-922432834
lutris has an option to pre-launch scripts before starting the game, and also post-exit scripts. the scripts are started in the background, and the game is launched too without regards to the completion of the script (though, there is an option to make it wait for the script to complete).
right now, we use lutris output-script
to get the environment variables that lutris launches gw2 with. i verified that atleast options like wine runner, prefix and whether winefsync is enabled MUST match between gw2 and burrito_link.
more details https://github.com/coderedart/jokolink/issues/3
but with the pre-launch scripts, those env variables are already set and then the script is called. so, we can just do $WINE burrito_link.exe
and that will launch burrito_link with the same env as gw2.
Even better is the fact that the script and any subprocesses it starts will all be killed by lutris when gw2 closes/crashes.
these are the rough instructions which are very straightforward. maybe screenshots would be helpful but i didn't know how to add them to readme
https://github.com/coderedart/jokolink#instructions
Disadvantages:
and finally, this can also be used to start the overlay itself along with the link in the same script.
I tested out the prelaunch script idea and it seems to work pretty well. Lutris didn't seem to work with relative paths, but if you write the script like this, it should work regardless of where burrito is located:
#!/bin/bash
# Fetch location of this script resolving symlinks
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
$WINE "${parent_path}/burrito_link.exe"
link is not a linux binary, so .local/bin
doesn't make sense. I decided with gw2 prefix, lutris will start script with prefix folder as current working directory.
If we get a default script, this issue is pretty much done i think.
To make it not so lutris dependent, you could also create a windows-batch script which will start gw2.exe and burrito-link.exe. :)
It's just a start 🙂 the link or overlay itself does not know about lutris, so there is no difference between having run_link.sh or run_link.ps . Launching with gw2 is more complicated due to runner or prefix or fsync mismatch which only happen with lutris. That's why it needs special care. Armored already runs gw2 with a script and starting link is ez with that. Same with windows, you can start it from anywhere.
I am solving this issue slightly differently then proposed via #48. Instead of launching burrito_link when gw2 launches I am instead launching it when burrito itself launches. There will be a new setting inside of burrito that will facilitate this. However it is optional so all of the solutions presented so far here are still possible if desired.
it is definitely a good idea to launch link with overlay if that's the only time you are going to use it.
Burrito Link should be automatically run when Burrito is launched. This would cut down on an additional step. On Linux this would require some sort configuration file to indicate what wine environment variables should be set, and what the wine executable path should be. This config file will need to contain at least the same information that is included in the lutris run script.