From 61c3e82e661814fc48b43845d55f80de63b1002e Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Sun, 27 Oct 2024 00:21:44 -0400 Subject: [PATCH] Use custom wine for all wine binaries --- lib/sc-launch.sh | 26 +++++++++++++------------- lug-helper.sh | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/sc-launch.sh b/lib/sc-launch.sh index e323e82..7c940ea 100755 --- a/lib/sc-launch.sh +++ b/lib/sc-launch.sh @@ -33,13 +33,13 @@ export MESA_SHADER_CACHE_MAX_SIZE=10G #export DXVK_HUD=fps,compiler #export MANGOHUD=1 -##################################################### -# Configure the wine binary to be used +################################################################ +# Configure the wine binaries to be used # -# To use a custom wine runner, set its path here -# wine_exec="/path/to/custom/runner/bin/wine" -##################################################### -wine_exec="wine" +# To use a custom wine runner, set the path to its bin directory +# wine_path="/path/to/custom/runner/bin" +################################################################ +wine_path="$(command -v wine | xargs dirname)" ############################################# # Run optional prelaunch and postexit scripts @@ -47,8 +47,8 @@ wine_exec="wine" # To use, update the game install paths here, then create the scripts with your desired actions in them # Replace the trap line in the section below with the example provided here # -# "$HOME/Games/star-citizen/sc-prelaunch.sh" -# trap "update_check; wineserver -k; $HOME/Games/star-citizen/sc-postexit.sh" EXIT +# "$WINEPREFIX/sc-prelaunch.sh" +# trap "update_check; \"$wine_path\"/wineserver -k; \"$WINEPREFIX\"/sc-postexit.sh" EXIT ############################################# # It's a trap! @@ -56,19 +56,19 @@ wine_exec="wine" # Kill the wine prefix when this script exits # This makes sure there will be no lingering background wine processes update_check() { - while winedbg --command "info proc" | grep -qi "rsi.*setup"; do + while "$wine_path"/winedbg --command "info proc" | grep -qi "rsi.*setup"; do sleep 2 done } -trap "update_check; wineserver -k" EXIT +trap "update_check; \"$wine_path\"/wineserver -k" EXIT ################# # Launch the game ################# # To enable feral gamemode, replace the launch line below with: -# gamemoderun "$wine_exec" "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" +# gamemoderun "$wine_path"/wine "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" # # To enable gamescope and feral gamemode, replace the launch line below with the desired gamescope arguments. For example: -# gamescope --hdr-enabled -W 2560 -H 1440 --force-grab-cursor gamemoderun "$wine_exec" "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" +# gamescope --hdr-enabled -W 2560 -H 1440 --force-grab-cursor gamemoderun "$wine_path"/wine "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" -"$wine_exec" "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" +"$wine_path"/wine "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" diff --git a/lug-helper.sh b/lug-helper.sh index 7655671..cbad1a7 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -1360,10 +1360,10 @@ runner_manage_wine() { # Set the string sed will match against when editing the launch script # This will be used to detect the appropriate variable and replace its value # with the path to the downloaded item - post_download_sed_string="wine_exec=" + post_download_sed_string="wine_path=" # Set the value of the above variable that will be restored after a runner is deleted # In this case, we want to revert to calling system wine - post_delete_restore_value="wine" + post_delete_restore_value='$(command -v wine | xargs dirname)' # Call the download_manage function with the above configuration # The argument passed to the function is used for special handling @@ -2139,7 +2139,7 @@ post_download() { fi # Replace the specified variable - sed -i "s|^${post_download_sed_string}.*|${post_download_sed_string}\"${wine_prefix}/runners/${downloaded_item_name}/bin/wine\"|" "$wine_prefix/$wine_launch_script_name" + sed -i "s|^${post_download_sed_string}.*|${post_download_sed_string}\"${wine_prefix}/runners/${downloaded_item_name}/bin\"|" "$wine_prefix/$wine_launch_script_name" else message warning "The launch script will need to be edited manually!\n\n$wine_prefix/$wine_launch_script_name" fi @@ -2158,7 +2158,7 @@ post_download() { fi # Restore the specified variable - sed -i "s|^${post_download_sed_string}.*|${post_download_sed_string}\"${post_delete_restore_value}\"|" "$wine_prefix/$wine_launch_script_name" + sed -i "s#^${post_download_sed_string}.*#${post_download_sed_string}\"${post_delete_restore_value}\"#" "$wine_prefix/$wine_launch_script_name" else message warning "The launch script will need to be edited manually!\n\n$wine_prefix/$wine_launch_script_name" fi