2024-09-05 22:47:06 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-10-29 20:02:12 -04:00
|
|
|
################################################################################
|
|
|
|
# This script configures and launches Star Citizen.
|
|
|
|
# It is installed by the LUG Helper for a non-Lutris installation.
|
2024-09-05 22:47:06 -04:00
|
|
|
#
|
2024-10-29 20:02:12 -04:00
|
|
|
# The following .desktop files are added by wine during installation and then
|
|
|
|
# modified by the LUG Helper to call this script.
|
|
|
|
# They are automatically detected by most desktop environments for easy game
|
|
|
|
# launching.
|
2024-09-05 22:47:06 -04:00
|
|
|
#
|
2024-10-29 20:02:12 -04:00
|
|
|
################################################################################
|
2024-09-05 22:47:06 -04:00
|
|
|
# $HOME/Desktop/RSI Launcher.desktop
|
|
|
|
# $HOME/.local/share/applications/wine/Programs/Roberts Space Industries/RSI Launcher.desktop
|
2024-10-29 20:02:12 -04:00
|
|
|
################################################################################
|
2024-09-05 22:47:06 -04:00
|
|
|
#
|
2024-10-29 20:02:12 -04:00
|
|
|
# If you do not wish to use the above .desktop files, simply run this script
|
|
|
|
# from your terminal.
|
|
|
|
#
|
2024-11-06 16:12:33 -05:00
|
|
|
# version: 1.4
|
2024-10-29 20:02:12 -04:00
|
|
|
################################################################################
|
2024-09-27 10:08:29 -04:00
|
|
|
|
2024-10-29 17:25:08 -04:00
|
|
|
################################################################
|
2024-09-05 22:47:06 -04:00
|
|
|
# Configure the environment
|
|
|
|
# Add additional environment variables here as needed
|
2024-10-29 17:25:08 -04:00
|
|
|
################################################################
|
2024-09-05 22:47:06 -04:00
|
|
|
export WINEPREFIX="$HOME/Games/star-citizen"
|
2024-11-06 16:12:33 -05:00
|
|
|
launch_log="$WINEPREFIX/sc-launch.log"
|
|
|
|
|
2024-09-27 10:08:29 -04:00
|
|
|
export WINEDLLOVERRIDES=winemenubuilder.exe=d # Prevent updates from overwriting our .desktop entries
|
2024-10-08 00:01:25 -04:00
|
|
|
export WINEDEBUG=-all # Cut down on console debug messages
|
2024-10-10 12:29:04 -04:00
|
|
|
export EOS_USE_ANTICHEATCLIENTNULL=1
|
2024-10-22 19:13:35 -04:00
|
|
|
# Nvidia cache options
|
2024-09-05 22:47:06 -04:00
|
|
|
export __GL_SHADER_DISK_CACHE=1
|
2024-11-03 11:18:30 -05:00
|
|
|
export __GL_SHADER_DISK_CACHE_SIZE=10737418240
|
2024-10-22 19:13:35 -04:00
|
|
|
export __GL_SHADER_DISK_CACHE_PATH="$WINEPREFIX"
|
2024-11-01 12:53:54 -04:00
|
|
|
export __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1
|
2024-11-06 16:12:33 -05:00
|
|
|
# Mesa (AMD/Intel) shader cache options
|
2024-10-22 19:13:35 -04:00
|
|
|
export MESA_SHADER_CACHE_DIR="$WINEPREFIX"
|
2024-11-01 12:07:59 -04:00
|
|
|
export MESA_SHADER_CACHE_MAX_SIZE="10G"
|
2024-11-06 16:12:33 -05:00
|
|
|
# Optional HUDs
|
2024-09-06 00:15:02 -04:00
|
|
|
#export DXVK_HUD=fps,compiler
|
2024-09-05 22:47:06 -04:00
|
|
|
#export MANGOHUD=1
|
|
|
|
|
2024-10-27 00:21:44 -04:00
|
|
|
################################################################
|
|
|
|
# Configure the wine binaries to be used
|
2024-10-09 19:10:02 -04:00
|
|
|
#
|
2024-10-27 00:21:44 -04:00
|
|
|
# To use a custom wine runner, set the path to its bin directory
|
2024-10-29 21:33:07 -04:00
|
|
|
# export wine_path="/path/to/custom/runner/bin"
|
2024-10-27 00:21:44 -04:00
|
|
|
################################################################
|
2024-10-29 21:33:07 -04:00
|
|
|
export wine_path="$(command -v wine | xargs dirname)"
|
2024-10-09 19:10:02 -04:00
|
|
|
|
2024-10-29 20:02:12 -04:00
|
|
|
#############################################
|
|
|
|
# Get a shell
|
|
|
|
#############################################
|
2024-10-29 17:25:08 -04:00
|
|
|
# Drop us into a shell that contains the current environment
|
|
|
|
# This is useful for getting a wine control panel, debugging, etc.
|
|
|
|
# Usage: ./sc-launch.sh shell
|
|
|
|
if [ "$1" = "shell" ]; then
|
2024-10-30 18:13:33 -04:00
|
|
|
echo "Entering Wine prefix maintenance shell. Type 'exit' when done."
|
|
|
|
export PATH="$wine_path:$PATH"; export PS1="Wine: "
|
|
|
|
cd "$WINEPREFIX"; /usr/bin/env bash --norc; exit 0
|
2024-10-29 17:25:08 -04:00
|
|
|
fi
|
|
|
|
|
2024-09-18 15:03:04 -04:00
|
|
|
#############################################
|
2024-09-05 23:42:47 -04:00
|
|
|
# Run optional prelaunch and postexit scripts
|
2024-09-18 15:03:04 -04:00
|
|
|
#############################################
|
2024-10-29 20:02:12 -04:00
|
|
|
# To use, update the game install paths here, create the scripts with your
|
2024-10-30 18:13:33 -04:00
|
|
|
# desired actions in them, then place them in your prefix directory:
|
|
|
|
# sc-prelaunch.sh and sc-postexit.sh
|
2024-10-24 13:08:22 -04:00
|
|
|
# Replace the trap line in the section below with the example provided here
|
2024-09-10 21:51:27 -04:00
|
|
|
#
|
2024-10-27 00:21:44 -04:00
|
|
|
# "$WINEPREFIX/sc-prelaunch.sh"
|
|
|
|
# trap "update_check; \"$wine_path\"/wineserver -k; \"$WINEPREFIX\"/sc-postexit.sh" EXIT
|
2024-09-21 17:25:54 -04:00
|
|
|
|
2024-10-24 13:08:22 -04:00
|
|
|
#############################################
|
|
|
|
# It's a trap!
|
|
|
|
#############################################
|
2024-09-21 17:25:54 -04:00
|
|
|
# Kill the wine prefix when this script exits
|
|
|
|
# This makes sure there will be no lingering background wine processes
|
2024-10-24 13:08:22 -04:00
|
|
|
update_check() {
|
2024-10-27 00:21:44 -04:00
|
|
|
while "$wine_path"/winedbg --command "info proc" | grep -qi "rsi.*setup"; do
|
2024-10-24 13:08:22 -04:00
|
|
|
sleep 2
|
|
|
|
done
|
|
|
|
}
|
2024-10-27 00:21:44 -04:00
|
|
|
trap "update_check; \"$wine_path\"/wineserver -k" EXIT
|
2024-09-05 23:42:47 -04:00
|
|
|
|
2024-10-29 17:25:08 -04:00
|
|
|
#############################################
|
2024-09-05 22:47:06 -04:00
|
|
|
# Launch the game
|
2024-10-29 17:25:08 -04:00
|
|
|
#############################################
|
2024-09-10 21:51:27 -04:00
|
|
|
# To enable feral gamemode, replace the launch line below with:
|
2024-11-06 16:12:33 -05:00
|
|
|
# gamemoderun "$wine_path"/wine "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" > "$launch_log" 2>&1
|
2024-09-15 13:42:45 -04:00
|
|
|
#
|
2024-10-29 20:02:12 -04:00
|
|
|
# To enable gamescope and feral gamemode, replace the launch line below with the
|
|
|
|
# desired gamescope arguments. For example:
|
2024-11-06 16:12:33 -05:00
|
|
|
# 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" > "$launch_log" 2>&1
|
2024-09-10 21:51:27 -04:00
|
|
|
|
2024-11-06 16:12:33 -05:00
|
|
|
"$wine_path"/wine "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe" > "$launch_log" 2>&1
|