AsherGlick / Burrito

An overlay tool for Guild Wars 2 that works on linux
GNU General Public License v2.0
79 stars 18 forks source link

Burrito Link does not automatically start #7

Open AsherGlick opened 3 years ago

AsherGlick commented 3 years ago

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.

coderedart commented 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:

  1. It is not clear whether lutris will launch gw2 in case of the pre-launch script having errors. having extensive logging helps with this, but it is better to try launching the script manually to check for any possible errors before we setup this prelaunch thing.
  2. if the overlay is started with this script, we won't have a chance to save stuff like the markers being edited etc.. so, there must be a sort of autosave feature which will write all the live editing state to a file every 5 seconds or something like that.

and finally, this can also be used to start the overlay itself along with the link in the same script.

manvithn commented 3 years ago

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"
coderedart commented 3 years ago

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.

ikaru5 commented 3 years ago

To make it not so lutris dependent, you could also create a windows-batch script which will start gw2.exe and burrito-link.exe. :)

coderedart commented 3 years ago

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.

AsherGlick commented 2 years ago

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.

coderedart commented 2 years ago

it is definitely a good idea to launch link with overlay if that's the only time you are going to use it.