mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-01 15:10:34 +00:00
Compare commits
55 Commits
v1.9.2
...
662d78a021
Author | SHA1 | Date | |
---|---|---|---|
662d78a021 | |||
d10a84c5fe | |||
35e63f5bd5 | |||
f3166c77da | |||
707211962f | |||
5df5cb210d | |||
bf36fc96a9 | |||
702c678716 | |||
dedefebd2d | |||
d24e8b590b | |||
3daeb0b3b1 | |||
e8c93196ff | |||
1561e1a9f6 | |||
a0110720f6 | |||
c1af0383f2 | |||
74c5bd2275 | |||
48d49dd438 | |||
f080ae2bca | |||
72677ff7d5 | |||
42f9992abf | |||
786e3f4c13 | |||
08285946c8 | |||
dafc53615d | |||
3f72676c71 | |||
3d7702dfdd | |||
7ae0bcf330 | |||
8ce1a9a8ea | |||
431df4aabd | |||
9f2c72042e | |||
25b122e891 | |||
a76c3d0a1a | |||
25a773602e | |||
d5d7f75dde | |||
44bcbf8161 | |||
acad90a0a5 | |||
77c6fd46bb | |||
5c112831e0 | |||
274c674681 | |||
cf491f9151 | |||
199e548767 | |||
8087ffe564 | |||
b2b2312ce9 | |||
4ad9603aa3 | |||
709cb6dbae | |||
810f21415e | |||
3e982b3303 | |||
cfeb3a841f | |||
60af93add3 | |||
b64eaf88c5 | |||
e8d96c45a0 | |||
d8826f608c | |||
07a99d3aa1 | |||
b4791a0b7d | |||
e43a59ce7b | |||
fc98118ac5 |
14
README.md
14
README.md
@ -20,10 +20,16 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
|
||||
- Checks that the hard open file descriptors limit is set to at least 524288.
|
||||
- This limits the maximum number of open files on your system. On some Linux distributions, the default is set too low for Star Citizen.
|
||||
|
||||
`Install Star Citizen`
|
||||
- Launches Lutris and uses the bundled json to install Star Citizen
|
||||
|
||||
`Manage Lutris Runners`
|
||||
- Quickly install and delete Lutris wine runners
|
||||
|
||||
`User Folder Maintenance and Troubleshooting`
|
||||
`Manage DXVK Versions`
|
||||
- Quickly install and delete DXVK versions for Lutris
|
||||
|
||||
`Maintenance and Troubleshooting`
|
||||
- `Switch the helper between LIVE and PTU`
|
||||
- Toggle between targeting LIVE or PTU for all of the above options. Defaults to LIVE on each run.
|
||||
|
||||
@ -34,12 +40,15 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
|
||||
- To re-import your keybinds from within the game, select them from the list:
|
||||
- *Options->Keybindings->Control Profiles*
|
||||
|
||||
- `Delete my shaders only`
|
||||
- `Delete my shaders folder only`
|
||||
- Sometimes all you need to do between major version updates is delete your shaders directory.
|
||||
|
||||
- `Delete my DXVK cache`
|
||||
- A troubleshooting step that sometimes helps fix various issues and crashes.
|
||||
|
||||
- `Display Helper and Star Citizen directories`
|
||||
- Show all the directories currently in use by both the Helper and Star Citizen.
|
||||
|
||||
- `Reset Helper configs`
|
||||
- Delete the configs saved by the helper in *$XDG_CONFIG_HOME/starcitizen-lug/*
|
||||
|
||||
@ -62,4 +71,5 @@ Arch Linux: https://aur.archlinux.org/packages/lug-helper/
|
||||
- https://github.com/pstn
|
||||
- https://github.com/gort818
|
||||
- https://github.com/victort
|
||||
- https://github.com/Wrzlprnft
|
||||
- Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater
|
||||
|
632
lug-helper.sh
632
lug-helper.sh
@ -15,7 +15,9 @@
|
||||
# - Check your system for optimal settings and
|
||||
# change them as needed to prevent crashes.
|
||||
#
|
||||
# - Easily install and remove Lutris wine Runners.
|
||||
# - Install Star Citizen using a bundled Lutris install script
|
||||
#
|
||||
# - Easily install and remove Lutris wine Runners and DXVK versions.
|
||||
#
|
||||
# - Qickly wipe your Star Citizen USER folder as is recommended
|
||||
# by CIG after major version updates.
|
||||
@ -43,8 +45,11 @@
|
||||
# Contributor: https://github.com/pstn
|
||||
# Contributor: https://github.com/gort818
|
||||
# Contributor: https://github.com/victort
|
||||
# Contributor: https://github.com/Wrzlprnft
|
||||
# Runner Downloader inspired by:
|
||||
# https://github.com/richardtatum/sc-runner-updater
|
||||
#
|
||||
# License: GPLv3.0
|
||||
############################################################################
|
||||
|
||||
# Check if script is run as root
|
||||
@ -60,10 +65,10 @@ if [ ! -x "$(command -v curl)" ]; then
|
||||
notify-send "lug-helper" "The required package 'curl' was not found on this system.\n" --icon=dialog-warning
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v basename)" ]; then
|
||||
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v sort)" ] || [ ! -x "$(command -v basename)" ] || [ ! -x "$(command -v realpath)" ] || [ ! -x "$(command -v dirname)" ]; then
|
||||
# Print to stderr and also try warning the user through notify-send
|
||||
printf "lug-helper.sh: One or more required packages were not found on this system.\nPlease check that the following packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)\n" 1>&2
|
||||
notify-send "lug-helper" "One or more required packages were not found on this system.\nPlease check that the following packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)\n" --icon=dialog-warning
|
||||
printf "lug-helper.sh: One or more required packages were not found on this system.\nPlease check that the following coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\n" 1>&2
|
||||
notify-send "lug-helper" "One or more required packages were not found on this system.\nPlease check that the following coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\n" --icon=dialog-warning
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -77,6 +82,9 @@ data_dir="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||
# .config subdirectory
|
||||
conf_subdir="starcitizen-lug"
|
||||
|
||||
# Helper directory
|
||||
helper_dir="$(realpath "$0" | xargs dirname)"
|
||||
|
||||
# Temporary directory
|
||||
tmp_dir="$(mktemp -d --suffix=".lughelper")"
|
||||
trap 'rm -r "$tmp_dir"' EXIT
|
||||
@ -94,7 +102,7 @@ ptu_dir="PTU"
|
||||
|
||||
# Remaining directory paths are set at the end of the getdirs() function
|
||||
|
||||
############################################################################
|
||||
######## Runners ###########################################################
|
||||
|
||||
# Lutris wine runners directory
|
||||
runners_dir="$data_dir/lutris/runners/wine"
|
||||
@ -104,32 +112,52 @@ runners_dir="$data_dir/lutris/runners/wine"
|
||||
# The second is expected to contain the github api releases url
|
||||
# ie. "RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
||||
runner_sources=(
|
||||
"RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
||||
"RawFox" "https://api.github.com/repos/starcitizen-lug/raw-wine/releases"
|
||||
"Molotov/Snatella" "https://api.github.com/repos/snatella/wine-runner-sc/releases"
|
||||
"/dev/null" "https://api.github.com/repos/gort818/wine-sc-lug/releases"
|
||||
"GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases"
|
||||
)
|
||||
# Set a maximum number of runner versions to display from each url
|
||||
max_runners=20
|
||||
|
||||
######## DXVK ##############################################################
|
||||
|
||||
# Lutris dxvk directory
|
||||
dxvk_dir="$data_dir/lutris/runtime/dxvk"
|
||||
# URLs for downloading dxvk versions
|
||||
# Elements in this array must be added in quoted pairs of: "description" "url"
|
||||
# The first string in the pair is expected to contain the runner description
|
||||
# The second is expected to contain the github api releases url
|
||||
# ie. "Sporif Async" "https://api.github.com/repos/Sporif/dxvk-async/releases"
|
||||
dxvk_sources=(
|
||||
"Sporif Async" "https://api.github.com/repos/Sporif/dxvk-async/releases"
|
||||
"/dev/null" "https://api.github.com/repos/gort818/dxvk/releases"
|
||||
)
|
||||
|
||||
# Set a maximum number of versions to display from each download url
|
||||
max_download_items=20
|
||||
|
||||
# Pixels to add for each Zenity menu option
|
||||
# used to dynamically determine the height of menus
|
||||
menu_option_height="25"
|
||||
|
||||
############################################################################
|
||||
|
||||
# Use logo installed by a packaged version of this script if available
|
||||
# Otherwise, default to the logo in the same directory
|
||||
if [ -f "/usr/share/pixmaps/lug-logo.png" ]; then
|
||||
lug_logo="/usr/share/pixmaps/lug-logo.png"
|
||||
elif [ -f "lug-logo.png" ]; then
|
||||
lug_logo="lug-logo.png"
|
||||
elif [ -f "$helper_dir/lug-logo.png" ]; then
|
||||
lug_logo="$helper_dir/lug-logo.png"
|
||||
else
|
||||
lug_logo="info"
|
||||
fi
|
||||
|
||||
# Lutris install script
|
||||
install_script="$helper_dir/lug-lutris-install.json"
|
||||
|
||||
# Github repo and script version info
|
||||
repo="the-sane/lug-helper"
|
||||
releases_url="https://github.com/the-sane/lug-helper/releases"
|
||||
current_version="v1.9.2"
|
||||
repo="starcitizen-lug/lug-helper"
|
||||
releases_url="https://github.com/$repo/releases"
|
||||
current_version="v1.14"
|
||||
|
||||
############################################################################
|
||||
############################################################################
|
||||
@ -286,7 +314,7 @@ menu() {
|
||||
elif [ -z "$menu_height" ]; then
|
||||
debug_print exit "Script error: The string 'menu_height' was not set\nbefore calling the menu function. Aborting."
|
||||
elif [ -z "$cancel_label" ]; then
|
||||
debug_print exit "Script error: The string 'menu_height' was not set\nbefore calling the menu function. Aborting."
|
||||
debug_print exit "Script error: The string 'cancel_label' was not set\nbefore calling the menu function. Aborting."
|
||||
fi
|
||||
|
||||
# Use Zenity if it is available
|
||||
@ -393,7 +421,7 @@ getdirs() {
|
||||
# If we don't have the directory paths we need yet,
|
||||
# ask the user to provide them
|
||||
if [ -z "$wine_prefix" ] || [ -z "$game_path" ]; then
|
||||
message info "At the next screen, please select your Star Citizen WINE prefix.\nIt will be remembered for future use."
|
||||
message info "Star Citizen must be installed before proceeding.\n\nAt the next screen, please select your Star Citizen WINE prefix.\nIt will be remembered for future use."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Using Zenity file selection menus
|
||||
# Get the wine prefix directory
|
||||
@ -491,6 +519,42 @@ getdirs() {
|
||||
backup_path="$conf_dir/$conf_subdir"
|
||||
}
|
||||
|
||||
# Display all directories currently used by this helper and Star Citizen
|
||||
display_dirs() {
|
||||
# Helper configs and keybinds
|
||||
if [ -d "$conf_dir/$conf_subdir" ]; then
|
||||
dirs_list+=("\n\nHelper configuration:\n$conf_dir/$conf_subdir\n\nKeybind backups:\n$conf_dir/$conf_subdir/keybinds")
|
||||
fi
|
||||
|
||||
# Wine prefix
|
||||
if [ -f "$conf_dir/$conf_subdir/$wine_conf" ]; then
|
||||
dirs_list+="\n\nWine prefix:\n$(cat "$conf_dir/$conf_subdir/$wine_conf")"
|
||||
fi
|
||||
|
||||
# Star Citizen installation
|
||||
if [ -f "$conf_dir/$conf_subdir/$game_conf" ]; then
|
||||
dirs_list+="\n\nStar Citizen game directory:\n$(cat "$conf_dir/$conf_subdir/$game_conf")"
|
||||
fi
|
||||
|
||||
# Lutris runners
|
||||
if [ -d "$runners_dir" ]; then
|
||||
dirs_list+="\n\nLutris Runners:\n$runners_dir"
|
||||
fi
|
||||
|
||||
# Lutris dxvk
|
||||
if [ -d "$runners_dir" ]; then
|
||||
dirs_list+="\n\nLutris DXVK Versions:\n$dxvk_dir"
|
||||
fi
|
||||
|
||||
# Formatting
|
||||
message_heading="These directories are currently being used by this Helper and Star Citizen"
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
message_heading="<b>$message_heading</b>"
|
||||
fi
|
||||
|
||||
message info "$message_heading\n${dirs_list[@]}"
|
||||
}
|
||||
|
||||
# Save exported keybinds, wipe the USER directory, and restore keybinds
|
||||
sanitize() {
|
||||
# Prompt user to back up the current keybinds in the game
|
||||
@ -583,7 +647,7 @@ mapcount_check() {
|
||||
# Add to the results and actions arrays
|
||||
if [ "$mapcount" -ge 16777216 ]; then
|
||||
# All good
|
||||
preflight_pass+=("vm.max_map_count is set to at least 16777216.")
|
||||
preflight_pass+=("vm.max_map_count is set to $mapcount.")
|
||||
elif grep -E -x -q "vm.max_map_count" /etc/sysctl.conf /etc/sysctl.d/* 2>/dev/null; then
|
||||
# Was it supposed to have been set by sysctl?
|
||||
preflight_fail+=("vm.max_map_count is configured to at least 16777216 but the setting has not been loaded by your system.")
|
||||
@ -648,7 +712,7 @@ filelimit_check() {
|
||||
# Add to the results and actions arrays
|
||||
if [ "$filelimit" -ge 524288 ]; then
|
||||
# All good
|
||||
preflight_pass+=("Hard open file descriptors limit is set to at least 524288.")
|
||||
preflight_pass+=("Hard open file descriptors limit is set to $filelimit.")
|
||||
else
|
||||
# The file limit should be changed
|
||||
preflight_fail+=("Your hard open file descriptors limit is $filelimit\nand should be set to at least 524288\nto increase the maximum number of open files.")
|
||||
@ -692,6 +756,23 @@ avx_check() {
|
||||
|
||||
#------------------------- end preflight check functions ---------------------#
|
||||
|
||||
# Install Star Citizen using Lutris
|
||||
install_game() {
|
||||
# Check if Lutris is installed
|
||||
if [ ! -x "$(command -v lutris)" ]; then
|
||||
message warning "Lutris is required but does not appear to be installed."
|
||||
return 0
|
||||
fi
|
||||
# Check if the install script exists
|
||||
if [ ! -f "$install_script" ]; then
|
||||
message warning "Lutris install script not found.\n\n$install_script\n\nIt is included in our official releases here:\n$releases_url"
|
||||
return 0
|
||||
fi
|
||||
|
||||
lutris --install "$install_script" &
|
||||
message info "The installation will continue in Lutris"
|
||||
}
|
||||
|
||||
# Delete the shaders directory
|
||||
rm_shaders() {
|
||||
# Get/Set directory paths
|
||||
@ -739,12 +820,10 @@ rm_dxvkcache() {
|
||||
fi
|
||||
}
|
||||
|
||||
#------------------------- begin runner functions ----------------------------#
|
||||
|
||||
# Restart lutris
|
||||
lutris_restart() {
|
||||
if [ "$lutris_needs_restart" = "true" ] && [ "$(pgrep lutris)" ]; then
|
||||
if message question "Lutris must be restarted to detect runner changes.\nWould you like this Helper to restart it for you?"; then
|
||||
if message question "Lutris must be restarted to detect the changes.\nWould you like this Helper to restart it for you?"; then
|
||||
debug_print continue "Restarting Lutris..."
|
||||
pkill -SIGTERM lutris && nohup lutris </dev/null &>/dev/null &
|
||||
fi
|
||||
@ -752,44 +831,62 @@ lutris_restart() {
|
||||
lutris_needs_restart="false"
|
||||
}
|
||||
|
||||
# Delete the selected runner
|
||||
runner_delete() {
|
||||
#------------------------- begin download functions ----------------------------#
|
||||
|
||||
# Display post download message or instructions if needed
|
||||
# Expects the variables message_heading, post_download_msg_text,
|
||||
# post_download_msg_italics, and downloaded_item_name
|
||||
post_download() {
|
||||
if [ "$trigger_post_download" = "true" ]; then
|
||||
message_heading="Download Complete"
|
||||
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
message_heading="<b>$message_heading</b>"
|
||||
post_download_msg_italics="<i>$post_download_msg_italics</i>"
|
||||
fi
|
||||
message info "$message_heading\n\n$post_download_msg_text\n\n$post_download_msg_italics\n$downloaded_item_name"
|
||||
fi
|
||||
trigger_post_download="false"
|
||||
}
|
||||
|
||||
# Uninstall the selected item
|
||||
download_delete() {
|
||||
# This function expects an index number for the array
|
||||
# installed_runners to be passed in as an argument
|
||||
# installed_items to be passed in as an argument
|
||||
if [ -z "$1" ]; then
|
||||
debug_print exit "Script error: The runner_delete function expects an argument. Aborting."
|
||||
debug_print exit "Script error: The download_delete function expects an argument. Aborting."
|
||||
fi
|
||||
|
||||
runner_to_delete="$1"
|
||||
if message question "Are you sure you want to delete the following runner?\n\n${installed_runners[$runner_to_delete]}"; then
|
||||
rm -r "${installed_runners[$runner_to_delete]}"
|
||||
debug_print continue "Deleted ${installed_runners[$runner_to_delete]}"
|
||||
item_to_delete="$1"
|
||||
if message question "Are you sure you want to delete the following ${download_type}?\n\n${installed_items[$item_to_delete]}"; then
|
||||
rm -r "${installed_items[$item_to_delete]}"
|
||||
debug_print continue "Deleted ${installed_items[$item_to_delete]}"
|
||||
lutris_needs_restart="true"
|
||||
fi
|
||||
}
|
||||
|
||||
# List installed runners for deletion
|
||||
runner_select_delete() {
|
||||
# List installed items for deletion
|
||||
download_select_delete() {
|
||||
# Configure the menu
|
||||
menu_text_zenity="Select the Lutris runner you want to remove:"
|
||||
menu_text_terminal="Select the Lutris runner you want to remove:"
|
||||
menu_text_zenity="Select the $download_type you want to remove:"
|
||||
menu_text_terminal="Select the $download_type you want to remove:"
|
||||
menu_text_height="65"
|
||||
goback="Return to the runner management menu"
|
||||
unset installed_runners
|
||||
goback="Return to the $download_type management menu"
|
||||
unset installed_items
|
||||
unset menu_options
|
||||
unset menu_actions
|
||||
|
||||
# Create an array containing all directories in the runners_dir
|
||||
for runners_list in "$runners_dir"/*; do
|
||||
if [ -d "$runners_list" ]; then
|
||||
installed_runners+=("$runners_list")
|
||||
# Create an array containing all directories in the download_dir
|
||||
for items_list in "$download_dir"/*; do
|
||||
if [ -d "$items_list" ]; then
|
||||
installed_items+=("$items_list")
|
||||
fi
|
||||
done
|
||||
|
||||
# Create menu options for the installed runners
|
||||
for (( i=0; i<"${#installed_runners[@]}"; i++ )); do
|
||||
menu_options+=("$(basename "${installed_runners[i]}")")
|
||||
menu_actions+=("runner_delete $i")
|
||||
# Create menu options for the installed items
|
||||
for (( i=0; i<"${#installed_items[@]}"; i++ )); do
|
||||
menu_options+=("$(basename "${installed_items[i]}")")
|
||||
menu_actions+=("download_delete $i")
|
||||
done
|
||||
|
||||
# Complete the menu by adding the option to go back to the previous menu
|
||||
@ -809,147 +906,187 @@ runner_select_delete() {
|
||||
menu
|
||||
}
|
||||
|
||||
# Download and install the selected runner
|
||||
# Note: The variables runner_versions, contributor_url, and runner_url_type
|
||||
# Download and install the selected item
|
||||
# Note: The variables download_versions, contributor_url, and download_url_type
|
||||
# are expected to be set before calling this function
|
||||
runner_install() {
|
||||
download_install() {
|
||||
# This function expects an index number for the array
|
||||
# runner_versions to be passed in as an argument
|
||||
# download_versions to be passed in as an argument
|
||||
if [ -z "$1" ]; then
|
||||
debug_print exit "Script error: The runner_install function expects a numerical argument. Aborting."
|
||||
debug_print exit "Script error: The download_install function expects a numerical argument. Aborting."
|
||||
fi
|
||||
|
||||
# Get the runner filename including file extension
|
||||
runner_file="${runner_versions[$1]}"
|
||||
# Get the filename including file extension
|
||||
download_file="${download_versions[$1]}"
|
||||
|
||||
# Get the selected runner name minus the file extension
|
||||
# Get the selected item name minus the file extension
|
||||
# To add new file extensions, handle them here and in
|
||||
# the runner_select_install function below
|
||||
case "$runner_file" in
|
||||
# the download_select_install function below
|
||||
case "$download_file" in
|
||||
*.tar.gz)
|
||||
runner_name="$(basename "$runner_file" .tar.gz)"
|
||||
download_name="$(basename "$download_file" .tar.gz)"
|
||||
;;
|
||||
*.tgz)
|
||||
runner_name="$(basename "$runner_file" .tgz)"
|
||||
download_name="$(basename "$download_file" .tgz)"
|
||||
;;
|
||||
*.tar.xz)
|
||||
runner_name="$(basename "$runner_file" .tar.xz)"
|
||||
download_name="$(basename "$download_file" .tar.xz)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in runner_install function. Aborting."
|
||||
debug_print exit "Unknown archive filetype in download_install function. Aborting."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the selected runner url
|
||||
# Get the selected download url
|
||||
# To add new sources, handle them here and in the
|
||||
# runner_select_install function below
|
||||
if [ "$runner_url_type" = "github" ]; then
|
||||
runner_dl_url="$(curl -s "$contributor_url" | grep "browser_download_url.*$runner_file" | cut -d \" -f4)"
|
||||
# download_select_install function below
|
||||
if [ "$download_url_type" = "github" ]; then
|
||||
download_url="$(curl -s "$contributor_url" | grep "browser_download_url.*$download_file" | cut -d \" -f4)"
|
||||
else
|
||||
debug_print exit "Script error: Unknown api/url format in runner_sources array. Aborting."
|
||||
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
||||
fi
|
||||
|
||||
# Sanity check
|
||||
if [ -z "$runner_dl_url" ]; then
|
||||
message warning "Could not find the requested runner. The source API may be down or rate limited."
|
||||
if [ -z "$download_url" ]; then
|
||||
message warning "Could not find the requested ${download_type}. The source API may be down or rate limited."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Download the runner to the tmp directory
|
||||
debug_print continue "Downloading $runner_dl_url into $tmp_dir/$runner_file..."
|
||||
# Download the item to the tmp directory
|
||||
debug_print continue "Downloading $download_url into $tmp_dir/$download_file..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Format the curl progress bar for zenity
|
||||
mkfifo "$tmp_dir/lugpipe"
|
||||
cd "$tmp_dir" && curl -#LO "$runner_dl_url" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!"
|
||||
cd "$tmp_dir" && curl -#LO "$download_url" > "$tmp_dir/lugpipe" 2>&1 & curlpid="$!"
|
||||
stdbuf -oL tr '\r' '\n' < "$tmp_dir/lugpipe" | \
|
||||
grep --line-buffered -ve "100" | grep --line-buffered -o "[0-9]*\.[0-9]" | \
|
||||
(
|
||||
trap 'kill "$curlpid"' ERR
|
||||
zenity --progress --auto-close --title="Star Citizen LUG Helper" --text="Downloading Runner. This might take a moment.\n" 2>/dev/null
|
||||
zenity --progress --auto-close --title="Star Citizen LUG Helper" --text="Downloading ${download_type}. This might take a moment.\n" 2>/dev/null
|
||||
)
|
||||
|
||||
if [ "$?" -eq 1 ]; then
|
||||
# User clicked cancel
|
||||
debug_print continue "Download aborted. Removing $tmp_dir/$runner_file..."
|
||||
rm "$tmp_dir/$runner_file"
|
||||
debug_print continue "Download aborted. Removing $tmp_dir/$download_file..."
|
||||
rm "$tmp_dir/$download_file"
|
||||
rm "$tmp_dir/lugpipe"
|
||||
return 1
|
||||
fi
|
||||
rm "$tmp_dir/lugpipe"
|
||||
else
|
||||
# Standard curl progress bar
|
||||
(cd "$tmp_dir" && curl -LO "$runner_dl_url")
|
||||
(cd "$tmp_dir" && curl -LO "$download_url")
|
||||
fi
|
||||
|
||||
# Sanity check
|
||||
if [ ! -f "$tmp_dir/$runner_file" ]; then
|
||||
debug_print exit "Script error: The requested runner file was not downloaded. Aborting"
|
||||
if [ ! -f "$tmp_dir/$download_file" ]; then
|
||||
debug_print exit "Script error: The requested $download_type file was not downloaded. Aborting"
|
||||
fi
|
||||
|
||||
# Get the path of the first item listed in the archive
|
||||
# This should either be a subdirectory or the path ./
|
||||
# depending on how the archive was created
|
||||
first_filepath="$(stdbuf -oL tar -tf "$tmp_dir/$runner_file" | head -n 1)"
|
||||
# Extract the archive to the tmp directory
|
||||
debug_print continue "Extracting $download_type into $tmp_dir/$download_name..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir "$tmp_dir/$download_name" && tar -xf "$tmp_dir/$download_file" -C "$tmp_dir/$download_name" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Extracting ${download_type}...\n" 2>/dev/null
|
||||
else
|
||||
mkdir "$tmp_dir/$download_name" && tar -xf "$tmp_dir/$download_file" -C "$tmp_dir/$download_name"
|
||||
fi
|
||||
|
||||
# Extract the runner
|
||||
case "$first_filepath" in
|
||||
# If the files in the archive begin with ./ there is no subdirectory
|
||||
./*)
|
||||
debug_print continue "Installing runner into $runners_dir/$runner_name..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir -p "$runners_dir/$runner_name" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir/$runner_name" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing runner...\n" 2>/dev/null
|
||||
else
|
||||
mkdir -p "$runners_dir/$runner_name" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir/$runner_name"
|
||||
fi
|
||||
lutris_needs_restart="true"
|
||||
;;
|
||||
*)
|
||||
# Runners with a subdirectory in the archive
|
||||
debug_print continue "Installing runner into $runners_dir..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir -p "$runners_dir" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing runner...\n" 2>/dev/null
|
||||
else
|
||||
mkdir -p "$runners_dir" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir"
|
||||
fi
|
||||
lutris_needs_restart="true"
|
||||
;;
|
||||
esac
|
||||
# Check the contents of the extracted archive to determine the
|
||||
# directory structure we must create upon installation
|
||||
num_dirs=0
|
||||
num_files=0
|
||||
for extracted_item in "$tmp_dir/$download_name"/*; do
|
||||
if [ -d "$extracted_item" ]; then
|
||||
num_dirs="$(($num_dirs+1))"
|
||||
extracted_dir="$(basename "$extracted_item")"
|
||||
elif [ -f "$extracted_item" ]; then
|
||||
num_files="$(($num_files+1))"
|
||||
fi
|
||||
done
|
||||
|
||||
# Create the correct directory structure and install the item
|
||||
if [ "$num_dirs" -eq 0 ] && [ "$num_files" -eq 0 ]; then
|
||||
# Sanity check
|
||||
message warning "The downloaded archive is empty. There is nothing to do."
|
||||
elif [ "$num_dirs" -eq 1 ] && [ "$num_files" -eq 0 ]; then
|
||||
# If the archive contains only one directory, install that directory
|
||||
# We rename it to the name of the archive in case it is different
|
||||
# so we can easily detect installed items in download_select_install()
|
||||
debug_print continue "Installing $download_type into $download_dir/$download_name..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir -p "$download_dir" && cp -r "$tmp_dir/$download_name/$extracted_dir" "$download_dir/$download_name" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
||||
else
|
||||
mkdir -p "$download_dir" && cp -r "$tmp_dir/$download_name/$extracted_dir" "$download_dir/$download_name"
|
||||
fi
|
||||
|
||||
# We need to restart Lutris for the download to be detected
|
||||
lutris_needs_restart="true"
|
||||
# Store the final name of the downloaded directory
|
||||
downloaded_item_name="$download_name"
|
||||
# Trigger the post_download() function
|
||||
trigger_post_download="true"
|
||||
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
||||
# If the archive contains more than one directory or
|
||||
# one or more files, we must create a subdirectory
|
||||
debug_print continue "Installing $download_type into $download_dir/$download_name..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir -p "$download_dir/$download_name" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir"/"$download_name" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
||||
else
|
||||
mkdir -p "$download_dir/$download_name" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir"/"$download_name"
|
||||
fi
|
||||
|
||||
# We need to restart Lutris for the download to be detected
|
||||
lutris_needs_restart="true"
|
||||
# Store the final name of the downloaded directory
|
||||
downloaded_item_name="$download_name"
|
||||
# Trigger the post_download() function
|
||||
trigger_post_download="true"
|
||||
else
|
||||
# Some unexpected combination of directories and files
|
||||
debug_print exit "Script error: Unexpected archive contents in download_install function. Aborting"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Cleanup tmp download
|
||||
debug_print continue "Removing $tmp_dir/$runner_file..."
|
||||
rm "$tmp_dir/$runner_file"
|
||||
debug_print continue "Cleaning up $tmp_dir/$download_file..."
|
||||
rm "$tmp_dir/$download_file"
|
||||
|
||||
# Display any post-download messages or instructions
|
||||
post_download
|
||||
}
|
||||
|
||||
# List available runners for download
|
||||
runner_select_install() {
|
||||
# This function expects an element number for the array
|
||||
# runner_sources to be passed in as an argument
|
||||
# List available items for download
|
||||
download_select_install() {
|
||||
# This function expects an element number for the sources array
|
||||
# to be passed in as an argument
|
||||
if [ -z "$1" ]; then
|
||||
debug_print exit "Script error: The runner_select_install function expects a numerical argument. Aborting."
|
||||
debug_print exit "Script error: The download_select_install function expects a numerical argument. Aborting."
|
||||
fi
|
||||
|
||||
# Store info from the selected contributor
|
||||
contributor_name="${runner_sources[$1]}"
|
||||
contributor_url="${runner_sources[$1+1]}"
|
||||
contributor_name="${download_sources[$1]}"
|
||||
contributor_url="${download_sources[$1+1]}"
|
||||
|
||||
# Check the provided contributor url to make sure we know how to handle it
|
||||
# To add new sources, add them here and handle in the if statement
|
||||
# just below and the runner_install function above
|
||||
# just below and the download_install function above
|
||||
case "$contributor_url" in
|
||||
https://api.github.com*)
|
||||
runner_url_type="github"
|
||||
download_url_type="github"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Script error: Unknown api/url format in runner_sources array. Aborting."
|
||||
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check GlibC version against the requirements of the selected runner
|
||||
if [ "$contributor_name" = "/dev/null" ]; then
|
||||
# For runners, check GlibC version against runner requirements
|
||||
if [ "download_type" = "runner" ] && [ "$contributor_name" = "/dev/null" ]; then
|
||||
required_glibc="2.33"
|
||||
system_glibc="$(ldd --version | awk '/ldd/{print $NF}')"
|
||||
|
||||
@ -959,57 +1096,57 @@ runner_select_install() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Fetch a list of runner versions from the selected contributor
|
||||
# Fetch a list of versions from the selected contributor
|
||||
# To add new sources, handle them here, in the if statement
|
||||
# just above, and the runner_install function above
|
||||
if [ "$runner_url_type" = "github" ]; then
|
||||
runner_versions=($(curl -s "$contributor_url" | awk '/browser_download_url/ {print $2}' | grep -vE "*.sha512sum" | xargs basename -a))
|
||||
# just above, and the download_install function above
|
||||
if [ "$download_url_type" = "github" ]; then
|
||||
download_versions=($(curl -s "$contributor_url" | awk '/browser_download_url/ {print $2}' | grep -vE "*.sha512sum" | xargs basename -a))
|
||||
else
|
||||
debug_print exit "Script error: Unknown api/url format in runner_sources array. Aborting."
|
||||
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
||||
fi
|
||||
|
||||
# Sanity check
|
||||
if [ "${#runner_versions[@]}" -eq 0 ]; then
|
||||
message warning "No runner versions were found. The source API may be down or rate limited."
|
||||
if [ "${#download_versions[@]}" -eq 0 ]; then
|
||||
message warning "No $download_type versions were found. The source API may be down or rate limited."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Configure the menu
|
||||
menu_text_zenity="Select the Lutris runner you want to install:"
|
||||
menu_text_terminal="Select the Lutris runner you want to install:"
|
||||
menu_text_zenity="Select the $download_type you want to install:"
|
||||
menu_text_terminal="Select the $download_type you want to install:"
|
||||
menu_text_height="65"
|
||||
goback="Return to the runner management menu"
|
||||
goback="Return to the $download_type management menu"
|
||||
unset menu_options
|
||||
unset menu_actions
|
||||
|
||||
# Iterate through the versions, check if they are installed,
|
||||
# and add them to the menu options
|
||||
# To add new file extensions, handle them here and in
|
||||
# the runner_install function above
|
||||
for (( i=0; i<"$max_runners" && i<"${#runner_versions[@]}"; i++ )); do
|
||||
# Get the runner name minus the file extension
|
||||
case "${runner_versions[i]}" in
|
||||
# the download_install function above
|
||||
for (( i=0; i<"$max_download_items" && i<"${#download_versions[@]}"; i++ )); do
|
||||
# Get the file name minus the extension
|
||||
case "${download_versions[i]}" in
|
||||
*.tar.gz)
|
||||
runner_name="$(basename "${runner_versions[i]}" .tar.gz)"
|
||||
download_name="$(basename "${download_versions[i]}" .tar.gz)"
|
||||
;;
|
||||
*.tgz)
|
||||
runner_name="$(basename "${runner_versions[i]}" .tgz)"
|
||||
download_name="$(basename "${download_versions[i]}" .tgz)"
|
||||
;;
|
||||
*.tar.xz)
|
||||
runner_name="$(basename "${runner_versions[i]}" .tar.xz)"
|
||||
download_name="$(basename "${download_versions[i]}" .tar.xz)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in runner_select_install function. Aborting."
|
||||
debug_print exit "Unknown archive filetype in download_select_install function. Aborting."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Add the runner names to the menu
|
||||
if [ -d "$runners_dir/$runner_name" ]; then
|
||||
menu_options+=("$runner_name [installed]")
|
||||
# Add the file names to the menu
|
||||
if [ -d "$download_dir/$download_name" ]; then
|
||||
menu_options+=("$download_name [installed]")
|
||||
else
|
||||
menu_options+=("$runner_name")
|
||||
menu_options+=("$download_name")
|
||||
fi
|
||||
menu_actions+=("runner_install $i")
|
||||
menu_actions+=("download_install $i")
|
||||
done
|
||||
|
||||
# Complete the menu by adding the option to go back to the previous menu
|
||||
@ -1029,45 +1166,71 @@ runner_select_install() {
|
||||
menu
|
||||
}
|
||||
|
||||
# Manage Lutris runners
|
||||
runner_manage() {
|
||||
# Manage downloads
|
||||
#
|
||||
# This function expects the following variables to be set:
|
||||
#
|
||||
# - The string download_sources is a formatted array containing the URLs
|
||||
# of items to download. It should be pointed to the appropriate
|
||||
# array set at the top of the script using indirect expansion.
|
||||
# See runner_sources at the top and runner_manage() below for examples.
|
||||
# - The string download_dir should contain the location the downloaded item
|
||||
# will be installed to.
|
||||
# - The string "download_menu_heading" should contain the type of item
|
||||
# being downloaded. It will appear in the menu heading.
|
||||
# - The string "download_menu_description" should contain a description of
|
||||
# the item being downloaded. It will appear in the menu subheading.
|
||||
# - The integer "download_menu_height" specifies the height of the zenity menu.
|
||||
#
|
||||
# This function also expects one string argument containing the type of item to
|
||||
# be downloaded. ie. runner or dxvk.
|
||||
#
|
||||
# See runner_manage below for a configuration example.
|
||||
download_manage() {
|
||||
# This function expects a string to be passed as an argument
|
||||
if [ -z "$1" ]; then
|
||||
debug_print exit "Script error: The download_manage function expects a string argument. Aborting."
|
||||
fi
|
||||
# Check if Lutris is installed
|
||||
if [ ! -x "$(command -v lutris)" ]; then
|
||||
message info "Lutris does not appear to be installed."
|
||||
return 0
|
||||
fi
|
||||
if [ ! -d "$runners_dir" ]; then
|
||||
message info "Lutris runners directory not found. Unable to continue.\n\n$runners_dir"
|
||||
if [ ! -d "$download_dir" ]; then
|
||||
message info "Lutris $download_type directory not found. Unable to continue.\n\n$download_dir"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# The runner management menu will loop until the user cancels
|
||||
# Get the type of item we're downloading from the function arguments
|
||||
download_type="$1"
|
||||
|
||||
# The download management menu will loop until the user cancels
|
||||
looping_menu="true"
|
||||
while [ "$looping_menu" = "true" ]; do
|
||||
# Configure the menu
|
||||
menu_text_zenity="<b><big>Manage Your Lutris Runners</big>\n\nThe runners listed below are wine builds created for Star Citizen</b>\n\nYou may choose from the following options:"
|
||||
menu_text_terminal="Manage Your Lutris Runners\n\nThe runners listed below are wine builds created for Star Citizen\nYou may choose from the following options:"
|
||||
menu_text_height="140"
|
||||
menu_text_zenity="<b><big>Manage Your $download_menu_heading</big>\n\n$download_menu_description</b>\n\nYou may choose from the following options:"
|
||||
menu_text_terminal="Manage Your $download_menu_heading\n\n$download_menu_description\nYou may choose from the following options:"
|
||||
menu_text_height="$download_menu_height"
|
||||
|
||||
# Configure the menu options
|
||||
delete="Remove an installed runner"
|
||||
delete="Remove an installed $download_type"
|
||||
back="Return to the main menu"
|
||||
unset menu_options
|
||||
unset menu_actions
|
||||
|
||||
# Loop through the runner_sources array and create a menu item
|
||||
# Loop through the download_sources array and create a menu item
|
||||
# for each one. Even numbered elements will contain the runner name
|
||||
for (( i=0; i<"${#runner_sources[@]}"; i=i+2 )); do
|
||||
for (( i=0; i<"${#download_sources[@]}"; i=i+2 )); do
|
||||
# Set the options to be displayed in the menu
|
||||
menu_options+=("Install a runner from ${runner_sources[i]}")
|
||||
menu_options+=("Install a $download_type from ${download_sources[i]}")
|
||||
# Set the corresponding functions to be called for each of the options
|
||||
menu_actions+=("runner_select_install $i")
|
||||
menu_actions+=("download_select_install $i")
|
||||
done
|
||||
|
||||
# Complete the menu by adding options to remove a runner
|
||||
# Complete the menu by adding options to uninstall an item
|
||||
# or go back to the previous menu
|
||||
menu_options+=("$delete" "$back")
|
||||
menu_actions+=("runner_select_delete" "menu_loop_done")
|
||||
menu_actions+=("download_select_delete" "menu_loop_done")
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
@ -1083,7 +1246,71 @@ runner_manage() {
|
||||
lutris_restart
|
||||
}
|
||||
|
||||
#-------------------------- end runner functions -----------------------------#
|
||||
#-------------------------- end download functions -----------------------------#
|
||||
|
||||
# Configure the download_manage function for runners
|
||||
runner_manage() {
|
||||
# Set some defaults
|
||||
lutris_needs_restart="false"
|
||||
trigger_post_download="false"
|
||||
|
||||
# Use indirect expansion to point download_sources
|
||||
# to the runner_sources array set at the top of the script
|
||||
declare -n download_sources=runner_sources
|
||||
download_dir="$runners_dir"
|
||||
|
||||
# Configure the text displayed in the menus
|
||||
download_menu_heading="Lutris Runners"
|
||||
download_menu_description="The runners listed below are wine builds created for Star Citizen"
|
||||
download_menu_height="140"
|
||||
|
||||
# Set the post download instructions
|
||||
# Format:
|
||||
# A header is automatically displayed that reads: Download Complete
|
||||
# msg_text is displayed below the header
|
||||
# msg_italics is displayed below that in italics when zenity is in use
|
||||
# Lastly, the downloaded directory name is automatically displayed
|
||||
post_download_msg_text="Select the runner in Lutris from the dropdown menu"
|
||||
post_download_msg_italics="Configure->Runner Options->Wine version"
|
||||
|
||||
# Call the download_manage function with the above configuration
|
||||
# The argument passed to the function is used for special handling
|
||||
# and displayed in the menus and dialogs.
|
||||
download_manage "runner"
|
||||
}
|
||||
|
||||
# Configure the download_manage function for dxvks
|
||||
dxvk_manage() {
|
||||
# Set some defaults
|
||||
lutris_needs_restart="false"
|
||||
trigger_post_download="false"
|
||||
|
||||
# Use indirect expansion to point download_sources
|
||||
# to the dxvk_sources array set at the top of the script
|
||||
declare -n download_sources=dxvk_sources
|
||||
download_dir="$dxvk_dir"
|
||||
|
||||
# Configure the text displayed in the menus
|
||||
download_menu_heading="DXVK Versions"
|
||||
download_menu_description="The DXVK versions below may help improve game performance"
|
||||
download_menu_height="140"
|
||||
|
||||
# Set the post download instructions
|
||||
# Format:
|
||||
# A header is automatically displayed that reads: Download Complete
|
||||
# msg_text is displayed below the header
|
||||
# msg_italics is displayed below that in italics when zenity is in use
|
||||
# Lastly, the downloaded directory name is automatically displayed
|
||||
post_download_msg_text="Type the DXVK folder name in your Lutris settings"
|
||||
post_download_msg_italics="Configure->Runner Options->DXVK version"
|
||||
|
||||
# Call the download_manage function with the above configuration
|
||||
# The argument passed to the function is used for special handling
|
||||
# and displayed in the menus and dialogs.
|
||||
download_manage "dxvk"
|
||||
}
|
||||
|
||||
#-------------------------- end dxvk functions -----------------------------#
|
||||
|
||||
# Check that the system is optimized for Star Citizen
|
||||
preflight_check() {
|
||||
@ -1133,7 +1360,13 @@ preflight_check() {
|
||||
|
||||
# Display the results of the preflight check
|
||||
if [ -z "$preflight_fail_string" ]; then
|
||||
message info "Preflight Check Complete\n\nYour system is optimized for Star Citizen!\n\n$preflight_pass_string"
|
||||
# Formatting
|
||||
message_heading="Preflight Check Complete"
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
message_heading="<b>$message_heading</b>"
|
||||
fi
|
||||
|
||||
message info "$message_heading\n\nYour system is optimized for Star Citizen!\n\n$preflight_pass_string"
|
||||
else
|
||||
if [ -z "$preflight_action_funcs" ]; then
|
||||
message warning "$preflight_pass_string$preflight_fail_string"
|
||||
@ -1187,6 +1420,53 @@ preflight_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Deploy Easy Anti-Cheat Workaround
|
||||
eac_workaround() {
|
||||
# Get/set directory paths
|
||||
getdirs
|
||||
if [ "$?" -eq 1 ]; then
|
||||
# User cancelled and wants to return to the main menu
|
||||
# or there was an error
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Set the EAC directory path and hosts modification
|
||||
eac_dir="$wine_prefix/drive_c/users/$USER/AppData/Roaming/EasyAntiCheat"
|
||||
eac_hosts="127.0.0.1 modules-cdn.eac-prod.on.epicgames.com"
|
||||
|
||||
# Check if EAC is installed
|
||||
if [ ! -d "$eac_dir" ]; then
|
||||
message info "Easy Anti-Cheat does not appear to be installed yet.\nThere is nothing to do!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Configure message variables
|
||||
eac_title="Easy Anti-Cheat Workaround"
|
||||
eac_hosts_formatted="$eac_hosts"
|
||||
eac_dir_formatted="$eac_dir"
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
eac_title="<b>$eac_title</b>"
|
||||
eac_hosts_formatted="<i>$eac_hosts_formatted</i>"
|
||||
eac_dir_formatted="<i>$eac_dir_formatted</i>"
|
||||
fi
|
||||
|
||||
if message question "$eac_title\n\nThe following entry will be added to /etc/hosts:\n$eac_hosts_formatted\n\nThe following directory will be deleted:\n$eac_dir_formatted\n\n\nTo revert these changes, delete the above line from\n/etc/hosts and relaunch the game\n\nDo you want to proceed?"; then
|
||||
debug_print continue "Editing hosts file..."
|
||||
|
||||
# Use pollkit's pkexec for gui with a fallback to sudo
|
||||
if [ -x "$(command -v pkexec)" ]; then
|
||||
pkexec sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||
else
|
||||
sudo sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||
fi
|
||||
|
||||
debug_print continue "Deleting $eac_dir..."
|
||||
rm -r "$eac_dir"
|
||||
|
||||
message info "Easy Anti-Cheat workaround has been deployed!"
|
||||
fi
|
||||
}
|
||||
|
||||
# Show maintenance/troubleshooting options
|
||||
maintenance_menu() {
|
||||
# Loop the menu until the user selects quit
|
||||
@ -1202,13 +1482,14 @@ maintenance_menu() {
|
||||
sanitize_msg="Delete my Star Citizen USER folder and preserve my keybinds"
|
||||
shaders_msg="Delete my shaders folder only (Do this after each game update)"
|
||||
vidcache_msg="Delete my DXVK cache"
|
||||
dirs_msg="Display Helper and Star Citizen directories"
|
||||
reset_msg="Reset Helper configs"
|
||||
quit_msg="Return to the main menu"
|
||||
|
||||
# Set the options to be displayed in the menu
|
||||
menu_options=("$version_msg" "$sanitize_msg" "$shaders_msg" "$vidcache_msg" "$reset_msg" "$quit_msg")
|
||||
menu_options=("$version_msg" "$sanitize_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$reset_msg" "$quit_msg")
|
||||
# Set the corresponding functions to be called for each of the options
|
||||
menu_actions=("set_version" "sanitize" "rm_shaders" "rm_dxvkcache" "reset_helper" "menu_loop_done")
|
||||
menu_actions=("set_version" "sanitize" "rm_shaders" "rm_dxvkcache" "display_dirs" "reset_helper" "menu_loop_done")
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
@ -1224,7 +1505,7 @@ maintenance_menu() {
|
||||
# Get a random Penguin's Star Citizen referral code
|
||||
referral_randomizer() {
|
||||
# Populate the referral codes array
|
||||
referral_codes=("STAR-4TZD-6KMM" "STAR-4XM2-VM99" "STAR-2NPY-FCR2" "STAR-T9Z9-7W6P" "STAR-VLBF-W2QR" "STAR-BYR6-YHMF" "STAR-3X2H-VZMX" "STAR-BRWN-FB9T" "STAR-FG6Y-N4Q4" "STAR-VLD6-VZRG" "STAR-T9KF-LV77" "STAR-4XHB-R7RF" "STAR-9NVF-MRN7" "STAR-3Q4W-9TC3" "STAR-3SBK-7QTT" "STAR-XFBT-9TTK" "STAR-F3H9-YPHN" "STAR-BYK6-RCCL" "STAR-XCKH-W6T7" "STAR-H292-39WK" "STAR-ZRT5-PJB7" "STAR-GMBP-SH9Y" "STAR-PLWB-LMFY" "STAR-TNZN-H4ZT" "STAR-T5G5-L2GJ" "STAR-6TPV-7QH2" "STAR-THHD-TV3Y")
|
||||
referral_codes=("STAR-4TZD-6KMM" "STAR-4XM2-VM99" "STAR-2NPY-FCR2" "STAR-T9Z9-7W6P" "STAR-VLBF-W2QR" "STAR-BYR6-YHMF" "STAR-3X2H-VZMX" "STAR-BRWN-FB9T" "STAR-FG6Y-N4Q4" "STAR-VLD6-VZRG" "STAR-T9KF-LV77" "STAR-4XHB-R7RF" "STAR-9NVF-MRN7" "STAR-3Q4W-9TC3" "STAR-3SBK-7QTT" "STAR-XFBT-9TTK" "STAR-F3H9-YPHN" "STAR-BYK6-RCCL" "STAR-XCKH-W6T7" "STAR-H292-39WK" "STAR-ZRT5-PJB7" "STAR-GMBP-SH9Y" "STAR-PLWB-LMFY" "STAR-TNZN-H4ZT" "STAR-T5G5-L2GJ" "STAR-6TPV-7QH2" "STAR-THHD-TV3Y" "STAR-7ZFS-PK2L" "STAR-SRQN-43TB" "STAR-9TDG-D4H9" "STAR-BPH3-THJC" "STAR-HL3M-R5KC" "STAR-GBS5-LTVB" "STAR-CJ3Y-KZZ4" "STAR-5GRM-7HBY" "STAR-G2GX-Y2QJ" "STAR-YWY3-H4XX" "STAR-6VGM-PTKC" "STAR-T6MZ-QFHX" "STAR-T2K6-LXFW" "STAR-XN25-9CJJ" "STAR-47V3-4QGB" "STAR-YD4Z-TQZV" "STAR-XLN7-9XNJ" "STAR-N62T-2R39" "STAR-3S3D-9HXQ" "STAR-TRZF-NMCV" "STAR-TLLJ-SMG4")
|
||||
# Pick a random array element. Scale a floating point number for
|
||||
# a more random distribution than simply calling RANDOM
|
||||
random_code="${referral_codes[$(awk '{srand($2); print int(rand()*$1)}' <<< "${#referral_codes[@]} $RANDOM")]}"
|
||||
@ -1284,14 +1565,14 @@ if [ -x "$(command -v zenity)" ]; then
|
||||
use_zenity=1
|
||||
fi
|
||||
|
||||
# Set some defaults
|
||||
# Set defaults
|
||||
live_or_ptu="$live_dir"
|
||||
lutris_needs_restart="false"
|
||||
|
||||
# Check if a newer verison of the script is available
|
||||
latest_version=$(get_latest_release "$repo")
|
||||
latest_version="$(get_latest_release "$repo")"
|
||||
|
||||
if [ "$latest_version" != "$current_version" ]; then
|
||||
if [ "$latest_version" != "$current_version" ] &&
|
||||
[ "$current_version" = "$(printf "$current_version\n$latest_version" | sort -V | head -n1)" ]; then
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
releases_url_formatted="<a href='$releases_url'>$releases_url</a>"
|
||||
else
|
||||
@ -1311,13 +1592,16 @@ if [ "$#" -gt 0 ]; then
|
||||
printf "Star Citizen Linux Users Group Helper Script
|
||||
Usage: lug-helper <options>
|
||||
-p, --preflight-check Run system optimization checks
|
||||
-i, --install Install Star Citizen
|
||||
-m, --manage-runners Install or remove Lutris runners
|
||||
-k, --manage-dxvk Install or remove DXVK versions
|
||||
-u, --delete-user-folder Delete Star Citizen USER folder, preserving keybinds
|
||||
-s, --delete-shaders Delete Star Citizen shaders directory
|
||||
-c, --delete-dxvk-cache Delete Star Citizen dxvk cache file
|
||||
-t, --target=[live|ptu] Target LIVE or PTU (default live)
|
||||
-g, --use-gui=[yes|no] Use Zenity GUI (default yes)
|
||||
-g, --use-gui=[yes|no] Use Zenity GUI if available (default yes)
|
||||
-r, --get-referral Get a random LUG member's Star Citizen referral code
|
||||
-d, --show-directories Show all Star Citizen and LUG Helper directories
|
||||
-x, --reset-helper Delete saved lug-helper configs
|
||||
"
|
||||
exit 0
|
||||
@ -1325,9 +1609,15 @@ Usage: lug-helper <options>
|
||||
--preflight-check | -p )
|
||||
cargs+=("preflight_check")
|
||||
;;
|
||||
--install | -i )
|
||||
cargs+=("install_game")
|
||||
;;
|
||||
--manage-runners | -m )
|
||||
cargs+=("runner_manage")
|
||||
;;
|
||||
--manage-dxvk | -k )
|
||||
cargs+=("dxvk_manage")
|
||||
;;
|
||||
--delete-user-folder | -u )
|
||||
cargs+=("sanitize")
|
||||
;;
|
||||
@ -1366,6 +1656,9 @@ Usage: lug-helper <options>
|
||||
--get-referral | -r )
|
||||
cargs+=("referral_randomizer")
|
||||
;;
|
||||
--show-directories | -d )
|
||||
cargs+=("display_dirs")
|
||||
;;
|
||||
--reset-helper | -x )
|
||||
cargs+=("reset_helper")
|
||||
;;
|
||||
@ -1396,15 +1689,18 @@ while true; do
|
||||
|
||||
# Configure the menu options
|
||||
preflight_msg="Preflight Check (System Optimization)"
|
||||
install_msg="Install Star Citizen"
|
||||
eac_msg="Deploy Easy Anti-Cheat Workaround"
|
||||
runners_msg="Manage Lutris Runners"
|
||||
maintenance_msg="User Folder Maintenance and Troubleshooting"
|
||||
dxvk_msg="Manage DXVK Versions"
|
||||
maintenance_msg="Maintenance and Troubleshooting"
|
||||
randomizer_msg="Get a random Penguin's Star Citizen referral code"
|
||||
quit_msg="Quit"
|
||||
|
||||
# Set the options to be displayed in the menu
|
||||
menu_options=("$preflight_msg" "$runners_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg")
|
||||
menu_options=("$preflight_msg" "$install_msg" "$eac_msg" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg")
|
||||
# Set the corresponding functions to be called for each of the options
|
||||
menu_actions=("preflight_check" "runner_manage" "maintenance_menu" "referral_randomizer" "quit")
|
||||
menu_actions=("preflight_check" "install_game" "eac_workaround" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit")
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
|
90
lug-lutris-install.json
Normal file
90
lug-lutris-install.json
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"count": 1,
|
||||
"next": null,
|
||||
"previous": null,
|
||||
"results": [
|
||||
{
|
||||
"id": 10872,
|
||||
"game_id": 17622,
|
||||
"game_slug": "star-citizen",
|
||||
"name": "Star Citizen",
|
||||
"year": 2016,
|
||||
"user": "ungarscool1",
|
||||
"runner": "wine",
|
||||
"slug": "starcitizen-lutris-install",
|
||||
"version": "LIVE/PTU",
|
||||
"description": "Welcome to the Star Citizen installer maintained by the Star Citizen LUG!\r\nBefore continuing, please see our Quick Start Guide:\r\nhttps://github.com/starcitizen-lug/information-howtos/wiki\r\n\r\nFor help with the installer or to just hang out, we invite Linux Star Citizen players to join us: https://robertsspaceindustries.com/orgs/LUG/",
|
||||
"notes": "Performance may be choppy the first couple minutes after visiting a new place or performing a new activity while shaders compile. Subsequent arrival should not be choppy.\r\n\r\nIf you receive a Runtime Error you can continue using Star Citizen by dragging the dialog box to the side, but in-game VoIP and FoIP will cease to function until Star Citizen is restarted. Drop in to the LUG group's chat and forums, we have custom runners to work around this problem.\r\n\r\nPlease make sure you have all Wine dependencies properly installed, or your game may crash during start-up. See our wiki linked above for more information and instructions.\r\n\r\nTo prevent crashes in areas with lots of geometry, the game needs a Linux resource limit named \"vm.max_map_count\" increased. If you are following our Quick Start Guide and using our LUG Helper, the Preflight Check will do this for you. To set it manually, execute:\r\n\r\nsudo sysctl -w vm.max_map_count=16777216\r\n\r\nConsult your distro's documentation on how to set this permanently, or ask a LUG member.\r\n\r\nSee you in the 'verse!",
|
||||
"created_at": "2018-11-15T17:43:07.367000Z",
|
||||
"updated_at": "2021-12-24T00:49:16.775712Z",
|
||||
"draft": false,
|
||||
"published": true,
|
||||
"published_by": 64834,
|
||||
"rating": "",
|
||||
"steamid": null,
|
||||
"gogid": null,
|
||||
"gogslug": "",
|
||||
"humbleid": "",
|
||||
"humblestoreid": "",
|
||||
"humblestoreid_real": "",
|
||||
"script": {
|
||||
"files": [
|
||||
{
|
||||
"client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.5.4.exe"
|
||||
}
|
||||
],
|
||||
"game": {
|
||||
"arch": "win64",
|
||||
"args": null,
|
||||
"exe": "drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe",
|
||||
"prefix": "$GAMEDIR"
|
||||
},
|
||||
"installer": [
|
||||
{
|
||||
"task": {
|
||||
"arch": "win64",
|
||||
"description": "Creating Wine prefix",
|
||||
"name": "create_prefix",
|
||||
"prefix": "$GAMEDIR"
|
||||
}
|
||||
},
|
||||
{
|
||||
"task": {
|
||||
"app": "--force arial vcrun2019 win10",
|
||||
"arch": "win64",
|
||||
"description": "Installing dlls",
|
||||
"name": "winetricks",
|
||||
"prefix": "$GAMEDIR"
|
||||
}
|
||||
},
|
||||
{
|
||||
"task": {
|
||||
"arch": "win64",
|
||||
"args": "/S",
|
||||
"description": "Installing client",
|
||||
"executable": "client",
|
||||
"name": "wineexec",
|
||||
"prefix": "$GAMEDIR"
|
||||
}
|
||||
}
|
||||
],
|
||||
"system": {
|
||||
"env": {
|
||||
"DXVK_HUD": "0",
|
||||
"__GL_SHADER_DISK_CACHE": 1,
|
||||
"__GL_SHADER_DISK_CACHE_SIZE": "1073741824",
|
||||
"__GL_THREADED_OPTIMIZATIONS": "1"
|
||||
}
|
||||
},
|
||||
"wine": {
|
||||
"dxvk": true,
|
||||
"esync": true,
|
||||
"overrides": {
|
||||
"nvapi,nvapi64": "disabled"
|
||||
},
|
||||
}
|
||||
},
|
||||
"content": "files:\n- client: https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.5.4.exe\ngame:\n arch: win64\n args: null\n exe: drive_c/Program Files/Roberts Space Industries/RSI Launcher/RSI Launcher.exe\n prefix: $GAMEDIR\ninstaller:\n- task:\n arch: win64\n description: Creating Wine prefix\n name: create_prefix\n prefix: $GAMEDIR\n- task:\n app: --force arial vcrun2019 win10\n arch: win64\n description: Installing dlls\n name: winetricks\n prefix: $GAMEDIR\n- task:\n arch: win64\n args: /S\n description: Installing client\n executable: client\n name: wineexec\n prefix: $GAMEDIR\nsystem:\n env:\n DXVK_HUD: '0'\n __GL_SHADER_DISK_CACHE: 1\n __GL_SHADER_DISK_CACHE_SIZE: '1073741824'\n __GL_THREADED_OPTIMIZATIONS: '1'\nwine:\n dxvk: true\n esync: true\n overrides:\n nvapi,nvapi64: disabled\n"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user