2024-09-06 02:47:06 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This script configures and launches Star Citizen
|
|
|
|
# It is installed by the LUG Helper when the game is installed with Wine (not Lutris)
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
#############################################################################################
|
|
|
|
# $HOME/Desktop/RSI Launcher.desktop
|
|
|
|
# $HOME/.local/share/applications/wine/Programs/Roberts Space Industries/RSI Launcher.desktop
|
|
|
|
#############################################################################################
|
|
|
|
#
|
|
|
|
# If you do not wish to use the above .desktop files, then simply run this script from your terminal
|
|
|
|
|
2024-09-27 14:08:29 +00:00
|
|
|
|
|
|
|
#####################################################
|
2024-09-06 02:47:06 +00:00
|
|
|
# Configure the environment
|
|
|
|
# Add additional environment variables here as needed
|
2024-09-27 14:08:29 +00:00
|
|
|
#####################################################
|
2024-09-06 02:47:06 +00:00
|
|
|
export WINEPREFIX="$HOME/Games/star-citizen"
|
2024-09-27 14:08:29 +00:00
|
|
|
export WINEDLLOVERRIDES=winemenubuilder.exe=d # Prevent updates from overwriting our .desktop entries
|
2024-10-08 04:01:25 +00:00
|
|
|
export WINEDEBUG=-all # Cut down on console debug messages
|
2024-10-10 16:29:04 +00:00
|
|
|
export EOS_USE_ANTICHEATCLIENTNULL=1
|
2024-10-22 23:13:35 +00:00
|
|
|
# Nvidia cache options
|
2024-09-06 02:47:06 +00:00
|
|
|
export __GL_SHADER_DISK_CACHE=1
|
|
|
|
export __GL_SHADER_DISK_CACHE_SIZE=1073741824
|
2024-10-22 23:13:35 +00:00
|
|
|
export __GL_SHADER_DISK_CACHE_PATH="$WINEPREFIX"
|
|
|
|
export __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=true
|
|
|
|
# Mesa (AMD/Intel) Shader Cache Options
|
|
|
|
export MESA_SHADER_CACHE_DIR="$WINEPREFIX"
|
|
|
|
export MESA_SHADER_CACHE_MAX_SIZE=10G
|
2024-09-06 04:15:02 +00:00
|
|
|
#export DXVK_HUD=fps,compiler
|
2024-09-06 02:47:06 +00:00
|
|
|
#export MANGOHUD=1
|
|
|
|
|
2024-10-09 23:10:02 +00:00
|
|
|
#####################################################
|
|
|
|
# Configure the wine binary to be used
|
|
|
|
#
|
|
|
|
# To use a custom wine runner, set its path here
|
|
|
|
# wine_exec="/path/to/custom/runner/bin/wine"
|
|
|
|
#####################################################
|
|
|
|
wine_exec="wine"
|
|
|
|
|
2024-09-18 19:03:04 +00:00
|
|
|
#############################################
|
2024-09-06 03:42:47 +00:00
|
|
|
# Run optional prelaunch and postexit scripts
|
2024-09-18 19:03:04 +00:00
|
|
|
#############################################
|
2024-09-06 03:42:47 +00:00
|
|
|
# To use, update the game install paths here, then create the scripts with your desired actions in them
|
2024-10-24 17:08:22 +00:00
|
|
|
# Replace the trap line in the section below with the example provided here
|
2024-09-11 01:51:27 +00:00
|
|
|
#
|
2024-09-06 03:42:47 +00:00
|
|
|
# "$HOME/Games/star-citizen/sc-prelaunch.sh"
|
2024-10-24 17:08:22 +00:00
|
|
|
# trap "update_check; wineserver -k; $HOME/Games/star-citizen/sc-postexit.sh" EXIT
|
2024-09-21 21:25:54 +00:00
|
|
|
|
2024-10-24 17:08:22 +00:00
|
|
|
#############################################
|
|
|
|
# It's a trap!
|
|
|
|
#############################################
|
2024-09-21 21:25:54 +00:00
|
|
|
# Kill the wine prefix when this script exits
|
|
|
|
# This makes sure there will be no lingering background wine processes
|
2024-10-24 17:08:22 +00:00
|
|
|
update_check() {
|
2024-10-24 17:47:44 +00:00
|
|
|
while winedbg --command "info proc" | grep -qi "rsi.*setup"; do
|
2024-10-24 17:08:22 +00:00
|
|
|
sleep 2
|
|
|
|
done
|
|
|
|
}
|
|
|
|
trap "update_check; wineserver -k" EXIT
|
2024-09-06 03:42:47 +00:00
|
|
|
|
2024-09-18 19:03:04 +00:00
|
|
|
#################
|
2024-09-06 02:47:06 +00:00
|
|
|
# Launch the game
|
2024-09-18 19:03:04 +00:00
|
|
|
#################
|
2024-09-11 01:51:27 +00:00
|
|
|
# To enable feral gamemode, replace the launch line below with:
|
2024-10-09 23:10:02 +00:00
|
|
|
# gamemoderun "$wine_exec" "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe"
|
2024-09-15 17:42:45 +00:00
|
|
|
#
|
|
|
|
# To enable gamescope and feral gamemode, replace the launch line below with the desired gamescope arguments. For example:
|
2024-10-09 23:10:02 +00:00
|
|
|
# gamescope --hdr-enabled -W 2560 -H 1440 --force-grab-cursor gamemoderun "$wine_exec" "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe"
|
2024-09-11 01:51:27 +00:00
|
|
|
|
2024-10-09 23:10:02 +00:00
|
|
|
"$wine_exec" "C:\Program Files\Roberts Space Industries\RSI Launcher\RSI Launcher.exe"
|