Opens the user's default browser (xdg-open) while the websocat instance listens for further json outputs from Nexus. Stores it in nexus.env.
IT TOOK ME THREE HOURS TO FIGURE OUT THAT THE DAMN WEBSOCAT INSTANCE WAS CLOSING BEFORE GETTING THE TOKEN
Opens a websocat instance and generates a uuid to send to Nexus' servers, retrieving a connection token and storing it with the UUID in ~/.local/share/modorganizer2/nexus.env
Utilizes the UUID or connection token if they already exist in the .env file.
This script is intended to skip running winetricks if there are none to
install. However, we must always install arial and fontsmooth=rgb for
MO2 itself. Originally, these were copied into the game_protontricks
list for each game in gamesinfo/, so our test [ -n
"${game_protontricks[*]}" ] would correctly always run them.
However, in commit 8f696323 we removed these and placed them inline in
the script. This had the undesired effect of causing the above test to
fail if the game itself did not have any other tricks to install. This
meant we would not install arial and fontsmooth=rgb.
This patch makes a slight change. Rather than adding these args to the
final apply command, we add them to the game_protontricks list. This
makes our test correctly consider arial and fontsmooth=rgb when deciding
to run or not to run winetricks.
The test has also been changed to examine the number of items in the
list rather than building a string and testing the number of characters
in it, which is a bit more reliable.
There is a possibility that MO2 will work anyway, or the user would
prefer to mess around with running protontricks/winetricks themselves to
resolve the problem. To prevent this issue from becoming a hard block
to their progress, allow them to proceed with the installation by
answering "Yes" to a dangerquestion.
This script runs with an execution context of:
set -eu
set -o pipefail
Because of this, in the "steam" case, when protontricks.sh exits
unsuccessfully, the whole pipeline it's in shares its exit code
(because of pipefail). This in turn causes the entire installer to exit
(because of set -e).
This makes it impossible to display the "Error while installing
winetricks" dialog, because our installer exits before we have the
chance to test [ "$?" != "0" ]. Instead we show the default "Operation
canceled" dialog from our exit trap.
This patch wraps all the tricks.sh work in a conditional test, which
makes it `set -e` safe and allows us to display the correct dialog.