mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-01 15:20:38 +00:00
Compare commits
19 Commits
f3166c77da
...
v1.15
Author | SHA1 | Date | |
---|---|---|---|
deb84dd757 | |||
fc70cdc687 | |||
21444076de | |||
4b32177e97 | |||
b4762d4724 | |||
37c94af2ed | |||
6d56599e2f | |||
9909221dff | |||
a328b465ef | |||
8e28327e0f | |||
156a0884d4 | |||
809efb6a54 | |||
5afa8e7c19 | |||
49079818f6 | |||
227038a289 | |||
8f53957f3c | |||
662d78a021 | |||
d10a84c5fe | |||
35e63f5bd5 |
@ -1,4 +1,4 @@
|
|||||||
# LUG-Helper
|
# LUG Helper
|
||||||
**Star Citizen's Linux Users Group Helper Script**
|
**Star Citizen's Linux Users Group Helper Script**
|
||||||
https://robertsspaceindustries.com/orgs/LUG
|
https://robertsspaceindustries.com/orgs/LUG
|
||||||
|
|
||||||
|
479
lug-helper.sh
479
lug-helper.sh
@ -72,6 +72,8 @@ if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v sort)" ] || [ ! -x "$
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
######## Config ############################################################
|
||||||
|
|
||||||
wine_conf="winedir.conf"
|
wine_conf="winedir.conf"
|
||||||
game_conf="gamedir.conf"
|
game_conf="gamedir.conf"
|
||||||
|
|
||||||
@ -139,7 +141,7 @@ max_download_items=20
|
|||||||
# used to dynamically determine the height of menus
|
# used to dynamically determine the height of menus
|
||||||
menu_option_height="25"
|
menu_option_height="25"
|
||||||
|
|
||||||
############################################################################
|
######## Bundled Files #####################################################
|
||||||
|
|
||||||
# Use logo installed by a packaged version of this script if available
|
# Use logo installed by a packaged version of this script if available
|
||||||
# Otherwise, default to the logo in the same directory
|
# Otherwise, default to the logo in the same directory
|
||||||
@ -151,13 +153,23 @@ else
|
|||||||
lug_logo="info"
|
lug_logo="info"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Lutris install script
|
# Use Lutris install script installed by a packaged version of this script if available
|
||||||
install_script="$helper_dir/lug-lutris-install.json"
|
# Otherwise, default to the json in the same directory
|
||||||
|
if [ -f "/usr/share/lug-helper/lug-lutris-install.json" ]; then
|
||||||
|
install_script="/usr/share/lug-helper/lug-lutris-install.json"
|
||||||
|
else
|
||||||
|
install_script="$helper_dir/lug-lutris-install.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
######## Links #############################################################
|
||||||
|
|
||||||
|
# LUG Wiki
|
||||||
|
lug_wiki="https://github.com/starcitizen-lug/information-howtos/wiki"
|
||||||
|
|
||||||
# Github repo and script version info
|
# Github repo and script version info
|
||||||
repo="starcitizen-lug/lug-helper"
|
repo="starcitizen-lug/lug-helper"
|
||||||
releases_url="https://github.com/$repo/releases"
|
releases_url="https://github.com/$repo/releases"
|
||||||
current_version="v1.14"
|
current_version="v1.15"
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -421,7 +433,7 @@ getdirs() {
|
|||||||
# If we don't have the directory paths we need yet,
|
# If we don't have the directory paths we need yet,
|
||||||
# ask the user to provide them
|
# ask the user to provide them
|
||||||
if [ -z "$wine_prefix" ] || [ -z "$game_path" ]; then
|
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 install directory (WINE prefix)\nIt will be remembered for future use.\n\nLutris default install path: ~/Games/star-citizen"
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
# Using Zenity file selection menus
|
# Using Zenity file selection menus
|
||||||
# Get the wine prefix directory
|
# Get the wine prefix directory
|
||||||
@ -735,6 +747,15 @@ filelimit_check() {
|
|||||||
|
|
||||||
#------------------------- end filelimit functions ---------------------------#
|
#------------------------- end filelimit functions ---------------------------#
|
||||||
|
|
||||||
|
# Check if WINE is installed
|
||||||
|
wine_check() {
|
||||||
|
if [ -x "$(command -v wine)" ]; then
|
||||||
|
preflight_pass+=("Wine is installed on your system.")
|
||||||
|
else
|
||||||
|
preflight_fail+=("Wine does not appear to be installed.\nAt a minimum, wine dependencies must be installed.\nPlease refer to our Quick Start Guide:\n$lug_wiki")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Check total system memory
|
# Check total system memory
|
||||||
memory_check() {
|
memory_check() {
|
||||||
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf "%.1f \n", $2/1024/1024}' /proc/meminfo)"
|
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf "%.1f \n", $2/1024/1024}' /proc/meminfo)"
|
||||||
@ -754,73 +775,120 @@ avx_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check that the system is optimized for Star Citizen
|
||||||
|
preflight_check() {
|
||||||
|
# Initialize variables
|
||||||
|
unset preflight_pass
|
||||||
|
unset preflight_fail
|
||||||
|
unset preflight_action_funcs
|
||||||
|
unset preflight_actions
|
||||||
|
unset preflight_results
|
||||||
|
unset preflight_manual
|
||||||
|
unset preflight_followup
|
||||||
|
|
||||||
|
# Call the optimization functions to perform the checks
|
||||||
|
wine_check
|
||||||
|
memory_check
|
||||||
|
avx_check
|
||||||
|
mapcount_check
|
||||||
|
filelimit_check
|
||||||
|
|
||||||
|
# Populate info strings with the results and add formatting
|
||||||
|
if [ "${#preflight_pass[@]}" -gt 0 ]; then
|
||||||
|
preflight_pass_string="Passed Checks:"
|
||||||
|
for (( i=0; i<"${#preflight_pass[@]}"; i++ )); do
|
||||||
|
preflight_pass_string="$preflight_pass_string\n- ${preflight_pass[i]//\\n/\\n }"
|
||||||
|
done
|
||||||
|
# Add extra newlines if there are also failures to report
|
||||||
|
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
||||||
|
preflight_pass_string="$preflight_pass_string\n\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
||||||
|
preflight_fail_string="Failed Checks:"
|
||||||
|
for (( i=0; i<"${#preflight_fail[@]}"; i++ )); do
|
||||||
|
if [ "$i" -eq 0 ]; then
|
||||||
|
preflight_fail_string="$preflight_fail_string\n- ${preflight_fail[i]//\\n/\\n }"
|
||||||
|
else
|
||||||
|
preflight_fail_string="$preflight_fail_string\n\n- ${preflight_fail[i]//\\n/\\n }"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
for (( i=0; i<"${#preflight_manual[@]}"; i++ )); do
|
||||||
|
if [ "$i" -eq 0 ]; then
|
||||||
|
preflight_manual_string="${preflight_manual[i]}"
|
||||||
|
else
|
||||||
|
preflight_manual_string="$preflight_manual_string\n\n${preflight_manual[i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Display the results of the preflight check
|
||||||
|
if [ -z "$preflight_fail_string" ]; then
|
||||||
|
# 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"
|
||||||
|
elif message question "$preflight_pass_string$preflight_fail_string\n\nWould you like configuration issues to be fixed for you?"; then
|
||||||
|
# Call functions to build fixes for any issues found
|
||||||
|
for (( i=0; i<"${#preflight_action_funcs[@]}"; i++ )); do
|
||||||
|
${preflight_action_funcs[i]}
|
||||||
|
done
|
||||||
|
# Populate a string of actions to be executed
|
||||||
|
for (( i=0; i<"${#preflight_actions[@]}"; i++ )); do
|
||||||
|
if [ "$i" -eq 0 ]; then
|
||||||
|
preflight_actions_string="${preflight_actions[i]}"
|
||||||
|
else
|
||||||
|
preflight_actions_string="$preflight_actions_string; ${preflight_actions[i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Execute the actions set by the functions
|
||||||
|
if [ ! -z "$preflight_actions_string" ]; then
|
||||||
|
# Use pollkit's pkexec for gui with a fallback to sudo
|
||||||
|
if [ -x "$(command -v pkexec)" ]; then
|
||||||
|
pkexec sh -c "$preflight_actions_string"
|
||||||
|
else
|
||||||
|
sudo sh -c "$preflight_actions_string"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Call any followup functions
|
||||||
|
for (( i=0; i<"${#preflight_followup[@]}"; i++ )); do
|
||||||
|
${preflight_followup[i]}
|
||||||
|
done
|
||||||
|
|
||||||
|
# Populate the results string
|
||||||
|
for (( i=0; i<"${#preflight_results[@]}"; i++ )); do
|
||||||
|
if [ "$i" -eq 0 ]; then
|
||||||
|
preflight_results_string="${preflight_results[i]}"
|
||||||
|
else
|
||||||
|
preflight_results_string="$preflight_results_string\n\n${preflight_results[i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Display the results
|
||||||
|
message info "$preflight_results_string"
|
||||||
|
else
|
||||||
|
# User declined to automatically fix configuration issues
|
||||||
|
# Show manual configuration options
|
||||||
|
if [ ! -z "$preflight_manual_string" ]; then
|
||||||
|
message info "$preflight_manual_string"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#------------------------- end preflight check functions ---------------------#
|
#------------------------- end preflight check functions ---------------------#
|
||||||
|
|
||||||
# Install Star Citizen using Lutris
|
#------------------------- begin download functions ----------------------------#
|
||||||
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" &
|
# Restart lutris if necessary
|
||||||
message info "The installation will continue in Lutris"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Delete the shaders directory
|
|
||||||
rm_shaders() {
|
|
||||||
# Get/Set directory paths
|
|
||||||
getdirs
|
|
||||||
if [ "$?" -eq 1 ]; then
|
|
||||||
# User cancelled and wants to return to the main menu, or error
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Sanity check
|
|
||||||
if [ ! -d "$shaders_dir" ]; then
|
|
||||||
message warning "Shaders directory not found. There is nothing to delete!\n\n$shaders_dir"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Delete the shader directory
|
|
||||||
if message question "The following directory will be deleted:\n\n$shaders_dir\n\nDo you want to proceed?"; then
|
|
||||||
debug_print continue "Deleting $shaders_dir..."
|
|
||||||
rm -r "$shaders_dir"
|
|
||||||
message info "Your shaders have been deleted!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Delete DXVK cache
|
|
||||||
rm_dxvkcache() {
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Sanity check
|
|
||||||
if [ ! -f "$dxvk_cache" ]; then
|
|
||||||
message warning "Unable to find the DXVK cache file. There is nothing to delete!\n\n$dxvk_cache"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Delete the cache file
|
|
||||||
if message question "The following file will be deleted:\n\n$dxvk_cache\n\nDo you want to proceed?"; then
|
|
||||||
debug_print continue "Deleting $dxvk_cache..."
|
|
||||||
rm "$dxvk_cache"
|
|
||||||
message info "Your DXVK cache has been deleted!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Restart lutris
|
|
||||||
lutris_restart() {
|
lutris_restart() {
|
||||||
if [ "$lutris_needs_restart" = "true" ] && [ "$(pgrep lutris)" ]; then
|
if [ "$lutris_needs_restart" = "true" ] && [ "$(pgrep lutris)" ]; then
|
||||||
if message question "Lutris must be restarted to detect the 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
|
||||||
@ -831,22 +899,23 @@ lutris_restart() {
|
|||||||
lutris_needs_restart="false"
|
lutris_needs_restart="false"
|
||||||
}
|
}
|
||||||
|
|
||||||
#------------------------- begin download functions ----------------------------#
|
# Perform post-download actions, display messages or instructions
|
||||||
|
|
||||||
# Display post download message or instructions if needed
|
|
||||||
# Expects the variables message_heading, post_download_msg_text,
|
# Expects the variables message_heading, post_download_msg_text,
|
||||||
# post_download_msg_italics, and downloaded_item_name
|
# post_download_msg_italics, and downloaded_item_name
|
||||||
post_download() {
|
post_download() {
|
||||||
if [ "$trigger_post_download" = "true" ]; then
|
# Check if lutris needs to be restarted after making changes
|
||||||
|
lutris_restart
|
||||||
|
|
||||||
|
if [ "$display_post_download_msg" = "true" ]; then
|
||||||
message_heading="Download Complete"
|
message_heading="Download Complete"
|
||||||
|
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
message_heading="<b>$message_heading</b>"
|
message_heading="<b>$message_heading</b>"
|
||||||
post_download_msg_italics="<i>$post_download_msg_italics</i>"
|
post_download_msg_italics="<i>$post_download_msg_italics</i>"
|
||||||
fi
|
fi
|
||||||
message info "$message_heading\n\n$post_download_msg_text\n\n$post_download_msg_italics\n$downloaded_item_name"
|
message info "$message_heading\n\n$post_download_msg_text\n$post_download_msg_italics\n\n$downloaded_item_name"
|
||||||
fi
|
fi
|
||||||
trigger_post_download="false"
|
display_post_download_msg="false"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Uninstall the selected item
|
# Uninstall the selected item
|
||||||
@ -1028,7 +1097,7 @@ download_install() {
|
|||||||
# Store the final name of the downloaded directory
|
# Store the final name of the downloaded directory
|
||||||
downloaded_item_name="$download_name"
|
downloaded_item_name="$download_name"
|
||||||
# Trigger the post_download() function
|
# Trigger the post_download() function
|
||||||
trigger_post_download="true"
|
display_post_download_msg="true"
|
||||||
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
||||||
# If the archive contains more than one directory or
|
# If the archive contains more than one directory or
|
||||||
# one or more files, we must create a subdirectory
|
# one or more files, we must create a subdirectory
|
||||||
@ -1046,7 +1115,7 @@ download_install() {
|
|||||||
# Store the final name of the downloaded directory
|
# Store the final name of the downloaded directory
|
||||||
downloaded_item_name="$download_name"
|
downloaded_item_name="$download_name"
|
||||||
# Trigger the post_download() function
|
# Trigger the post_download() function
|
||||||
trigger_post_download="true"
|
display_post_download_msg="true"
|
||||||
else
|
else
|
||||||
# Some unexpected combination of directories and files
|
# Some unexpected combination of directories and files
|
||||||
debug_print exit "Script error: Unexpected archive contents in download_install function. Aborting"
|
debug_print exit "Script error: Unexpected archive contents in download_install function. Aborting"
|
||||||
@ -1056,9 +1125,6 @@ download_install() {
|
|||||||
# Cleanup tmp download
|
# Cleanup tmp download
|
||||||
debug_print continue "Cleaning up $tmp_dir/$download_file..."
|
debug_print continue "Cleaning up $tmp_dir/$download_file..."
|
||||||
rm "$tmp_dir/$download_file"
|
rm "$tmp_dir/$download_file"
|
||||||
|
|
||||||
# Display any post-download messages or instructions
|
|
||||||
post_download
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# List available items for download
|
# List available items for download
|
||||||
@ -1084,13 +1150,15 @@ download_select_install() {
|
|||||||
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# For runners, check GlibC version against runner requirements
|
# For runners, check GlibC version against runner requirements
|
||||||
if [ "download_type" = "runner" ] && [ "$contributor_name" = "/dev/null" ]; then
|
if [ "$download_type" = "runner" ] && [ "$contributor_name" = "/dev/null" ]; then
|
||||||
required_glibc="2.33"
|
required_glibc="2.33"
|
||||||
system_glibc="$(ldd --version | awk '/ldd/{print $NF}')"
|
system_glibc="$(ldd --version | awk '/ldd/{print $NF}')"
|
||||||
|
|
||||||
if [ "$(bc <<< "$required_glibc > $system_glibc")" = "1" ]; then
|
# Sort the versions and check if the installed glibc is smaller
|
||||||
|
if [ "$required_glibc" != "$system_glibc" ] &&
|
||||||
|
[ "$system_glibc" = "$(printf "$system_glibc\n$required_glibc" | sort -V | head -n1)" ]; then
|
||||||
message warning "Your glibc version is incompatible with the selected runner.\n\nSystem glibc: v$system_glibc\nMinimum required glibc: v$required_glibc"
|
message warning "Your glibc version is incompatible with the selected runner.\n\nSystem glibc: v$system_glibc\nMinimum required glibc: v$required_glibc"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -1240,19 +1308,16 @@ download_manage() {
|
|||||||
|
|
||||||
# Call the menu function. It will use the options as configured above
|
# Call the menu function. It will use the options as configured above
|
||||||
menu
|
menu
|
||||||
|
# Perform post-download actions and display messages or instructions
|
||||||
|
post_download
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check if lutris needs to be restarted after making changes
|
|
||||||
lutris_restart
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------- end download functions -----------------------------#
|
|
||||||
|
|
||||||
# Configure the download_manage function for runners
|
# Configure the download_manage function for runners
|
||||||
runner_manage() {
|
runner_manage() {
|
||||||
# Set some defaults
|
# Set some defaults
|
||||||
lutris_needs_restart="false"
|
lutris_needs_restart="false"
|
||||||
trigger_post_download="false"
|
display_post_download_msg="false"
|
||||||
|
|
||||||
# Use indirect expansion to point download_sources
|
# Use indirect expansion to point download_sources
|
||||||
# to the runner_sources array set at the top of the script
|
# to the runner_sources array set at the top of the script
|
||||||
@ -1270,7 +1335,7 @@ runner_manage() {
|
|||||||
# msg_text is displayed below the header
|
# msg_text is displayed below the header
|
||||||
# msg_italics is displayed below that in italics when zenity is in use
|
# msg_italics is displayed below that in italics when zenity is in use
|
||||||
# Lastly, the downloaded directory name is automatically displayed
|
# Lastly, the downloaded directory name is automatically displayed
|
||||||
post_download_msg_text="Select the runner in Lutris from the dropdown menu"
|
post_download_msg_text="Select the following runner in Lutris from the dropdown menu under:"
|
||||||
post_download_msg_italics="Configure->Runner Options->Wine version"
|
post_download_msg_italics="Configure->Runner Options->Wine version"
|
||||||
|
|
||||||
# Call the download_manage function with the above configuration
|
# Call the download_manage function with the above configuration
|
||||||
@ -1283,7 +1348,7 @@ runner_manage() {
|
|||||||
dxvk_manage() {
|
dxvk_manage() {
|
||||||
# Set some defaults
|
# Set some defaults
|
||||||
lutris_needs_restart="false"
|
lutris_needs_restart="false"
|
||||||
trigger_post_download="false"
|
display_post_download_msg="false"
|
||||||
|
|
||||||
# Use indirect expansion to point download_sources
|
# Use indirect expansion to point download_sources
|
||||||
# to the dxvk_sources array set at the top of the script
|
# to the dxvk_sources array set at the top of the script
|
||||||
@ -1301,7 +1366,7 @@ dxvk_manage() {
|
|||||||
# msg_text is displayed below the header
|
# msg_text is displayed below the header
|
||||||
# msg_italics is displayed below that in italics when zenity is in use
|
# msg_italics is displayed below that in italics when zenity is in use
|
||||||
# Lastly, the downloaded directory name is automatically displayed
|
# Lastly, the downloaded directory name is automatically displayed
|
||||||
post_download_msg_text="Type the DXVK folder name in your Lutris settings"
|
post_download_msg_text="Type the following DXVK name into your Lutris settings under:"
|
||||||
post_download_msg_italics="Configure->Runner Options->DXVK version"
|
post_download_msg_italics="Configure->Runner Options->DXVK version"
|
||||||
|
|
||||||
# Call the download_manage function with the above configuration
|
# Call the download_manage function with the above configuration
|
||||||
@ -1310,120 +1375,17 @@ dxvk_manage() {
|
|||||||
download_manage "dxvk"
|
download_manage "dxvk"
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------- end dxvk functions -----------------------------#
|
#-------------------------- end download functions -----------------------------#
|
||||||
|
|
||||||
# Check that the system is optimized for Star Citizen
|
|
||||||
preflight_check() {
|
|
||||||
# Initialize variables
|
|
||||||
unset preflight_pass
|
|
||||||
unset preflight_fail
|
|
||||||
unset preflight_action_funcs
|
|
||||||
unset preflight_actions
|
|
||||||
unset preflight_results
|
|
||||||
unset preflight_manual
|
|
||||||
unset preflight_followup
|
|
||||||
|
|
||||||
# Call the optimization functions to perform the checks
|
|
||||||
memory_check
|
|
||||||
avx_check
|
|
||||||
mapcount_check
|
|
||||||
filelimit_check
|
|
||||||
|
|
||||||
# Populate info strings with the results and add formatting
|
|
||||||
if [ "${#preflight_pass[@]}" -gt 0 ]; then
|
|
||||||
preflight_pass_string="Passed Checks:"
|
|
||||||
for (( i=0; i<"${#preflight_pass[@]}"; i++ )); do
|
|
||||||
preflight_pass_string="$preflight_pass_string\n- ${preflight_pass[i]//\\n/\\n }"
|
|
||||||
done
|
|
||||||
# Add extra newlines if there are also failures to report
|
|
||||||
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
|
||||||
preflight_pass_string="$preflight_pass_string\n\n"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "${#preflight_fail[@]}" -gt 0 ]; then
|
|
||||||
preflight_fail_string="Failed Checks:"
|
|
||||||
for (( i=0; i<"${#preflight_fail[@]}"; i++ )); do
|
|
||||||
if [ "$i" -eq 0 ]; then
|
|
||||||
preflight_fail_string="$preflight_fail_string\n- ${preflight_fail[i]//\\n/\\n }"
|
|
||||||
else
|
|
||||||
preflight_fail_string="$preflight_fail_string\n\n- ${preflight_fail[i]//\\n/\\n }"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
for (( i=0; i<"${#preflight_manual[@]}"; i++ )); do
|
|
||||||
if [ "$i" -eq 0 ]; then
|
|
||||||
preflight_manual_string="${preflight_manual[i]}"
|
|
||||||
else
|
|
||||||
preflight_manual_string="$preflight_manual_string\n\n${preflight_manual[i]}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Display the results of the preflight check
|
|
||||||
if [ -z "$preflight_fail_string" ]; then
|
|
||||||
# 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"
|
|
||||||
elif message question "$preflight_pass_string$preflight_fail_string\n\nWould you like configuration issues to be fixed for you?"; then
|
|
||||||
# Call functions to build fixes for any issues found
|
|
||||||
for (( i=0; i<"${#preflight_action_funcs[@]}"; i++ )); do
|
|
||||||
${preflight_action_funcs[i]}
|
|
||||||
done
|
|
||||||
# Populate a string of actions to be executed
|
|
||||||
for (( i=0; i<"${#preflight_actions[@]}"; i++ )); do
|
|
||||||
if [ "$i" -eq 0 ]; then
|
|
||||||
preflight_actions_string="${preflight_actions[i]}"
|
|
||||||
else
|
|
||||||
preflight_actions_string="$preflight_actions_string; ${preflight_actions[i]}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Execute the actions set by the functions
|
|
||||||
if [ ! -z "$preflight_actions_string" ]; then
|
|
||||||
# Use pollkit's pkexec for gui with a fallback to sudo
|
|
||||||
if [ -x "$(command -v pkexec)" ]; then
|
|
||||||
pkexec sh -c "$preflight_actions_string"
|
|
||||||
else
|
|
||||||
sudo sh -c "$preflight_actions_string"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Call any followup functions
|
|
||||||
for (( i=0; i<"${#preflight_followup[@]}"; i++ )); do
|
|
||||||
${preflight_followup[i]}
|
|
||||||
done
|
|
||||||
|
|
||||||
# Populate the results string
|
|
||||||
for (( i=0; i<"${#preflight_results[@]}"; i++ )); do
|
|
||||||
if [ "$i" -eq 0 ]; then
|
|
||||||
preflight_results_string="${preflight_results[i]}"
|
|
||||||
else
|
|
||||||
preflight_results_string="$preflight_results_string\n\n${preflight_results[i]}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Display the results
|
|
||||||
message info "$preflight_results_string"
|
|
||||||
else
|
|
||||||
# User declined to automatically fix configuration issues
|
|
||||||
# Show manual configuration options
|
|
||||||
if [ ! -z "$preflight_manual_string" ]; then
|
|
||||||
message info "$preflight_manual_string"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Deploy Easy Anti-Cheat Workaround
|
# Deploy Easy Anti-Cheat Workaround
|
||||||
eac_workaround() {
|
eac_workaround() {
|
||||||
# Get/set directory paths
|
# Get/set directory paths
|
||||||
getdirs
|
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
|
# Set the EAC directory path and hosts modification
|
||||||
eac_dir="$wine_prefix/drive_c/users/$USER/AppData/Roaming/EasyAntiCheat"
|
eac_dir="$wine_prefix/drive_c/users/$USER/AppData/Roaming/EasyAntiCheat"
|
||||||
@ -1431,7 +1393,7 @@ eac_workaround() {
|
|||||||
|
|
||||||
# Check if EAC is installed
|
# Check if EAC is installed
|
||||||
if [ ! -d "$eac_dir" ]; then
|
if [ ! -d "$eac_dir" ]; then
|
||||||
message info "Easy Anti-Cheat does not appear to be installed.\nThere is nothing to do!"
|
message info "Easy Anti-Cheat does not appear to be installed yet.\nThere is nothing to do!"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1462,6 +1424,78 @@ eac_workaround() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
if message question "Before proceeding, please refer to our Quick Start Guide:\n\n$lug_wiki\n\nAre you ready to continue?"; then
|
||||||
|
lutris --install "$install_script" &
|
||||||
|
message info "The installation will continue in Lutris"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Display the LUG Wiki
|
||||||
|
display_wiki() {
|
||||||
|
# Display a message containing the URL
|
||||||
|
message info "See the Wiki for our Quick-Start Guide, Manual Installation instructions,\nPerformance Tuning, and Common Issues and Solutions:\n\n$lug_wiki"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Delete the shaders directory
|
||||||
|
rm_shaders() {
|
||||||
|
# Get/Set directory paths
|
||||||
|
getdirs
|
||||||
|
if [ "$?" -eq 1 ]; then
|
||||||
|
# User cancelled and wants to return to the main menu, or error
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Sanity check
|
||||||
|
if [ ! -d "$shaders_dir" ]; then
|
||||||
|
message warning "Shaders directory not found. There is nothing to delete!\n\n$shaders_dir"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Delete the shader directory
|
||||||
|
if message question "The following directory will be deleted:\n\n$shaders_dir\n\nDo you want to proceed?"; then
|
||||||
|
debug_print continue "Deleting $shaders_dir..."
|
||||||
|
rm -r "$shaders_dir"
|
||||||
|
message info "Your shaders have been deleted!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Delete DXVK cache
|
||||||
|
rm_dxvkcache() {
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Sanity check
|
||||||
|
if [ ! -f "$dxvk_cache" ]; then
|
||||||
|
message warning "Unable to find the DXVK cache file. There is nothing to delete!\n\n$dxvk_cache"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Delete the cache file
|
||||||
|
if message question "The following file will be deleted:\n\n$dxvk_cache\n\nDo you want to proceed?"; then
|
||||||
|
debug_print continue "Deleting $dxvk_cache..."
|
||||||
|
rm "$dxvk_cache"
|
||||||
|
message info "Your DXVK cache has been deleted!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Show maintenance/troubleshooting options
|
# Show maintenance/troubleshooting options
|
||||||
maintenance_menu() {
|
maintenance_menu() {
|
||||||
# Loop the menu until the user selects quit
|
# Loop the menu until the user selects quit
|
||||||
@ -1478,13 +1512,14 @@ maintenance_menu() {
|
|||||||
shaders_msg="Delete my shaders folder only (Do this after each game update)"
|
shaders_msg="Delete my shaders folder only (Do this after each game update)"
|
||||||
vidcache_msg="Delete my DXVK cache"
|
vidcache_msg="Delete my DXVK cache"
|
||||||
dirs_msg="Display Helper and Star Citizen directories"
|
dirs_msg="Display Helper and Star Citizen directories"
|
||||||
|
wiki_msg="Show the LUG Wiki"
|
||||||
reset_msg="Reset Helper configs"
|
reset_msg="Reset Helper configs"
|
||||||
quit_msg="Return to the main menu"
|
quit_msg="Return to the main menu"
|
||||||
|
|
||||||
# Set the options to be displayed in the menu
|
# Set the options to be displayed in the menu
|
||||||
menu_options=("$version_msg" "$sanitize_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$reset_msg" "$quit_msg")
|
menu_options=("$version_msg" "$sanitize_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$wiki_msg" "$reset_msg" "$quit_msg")
|
||||||
# Set the corresponding functions to be called for each of the options
|
# Set the corresponding functions to be called for each of the options
|
||||||
menu_actions=("set_version" "sanitize" "rm_shaders" "rm_dxvkcache" "display_dirs" "reset_helper" "menu_loop_done")
|
menu_actions=("set_version" "sanitize" "rm_shaders" "rm_dxvkcache" "display_dirs" "display_wiki" "reset_helper" "menu_loop_done")
|
||||||
|
|
||||||
# Calculate the total height the menu should be
|
# Calculate the total height the menu should be
|
||||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||||
@ -1500,7 +1535,7 @@ maintenance_menu() {
|
|||||||
# Get a random Penguin's Star Citizen referral code
|
# Get a random Penguin's Star Citizen referral code
|
||||||
referral_randomizer() {
|
referral_randomizer() {
|
||||||
# Populate the referral codes array
|
# 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" "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")
|
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" "STAR-MFT6-Q44H" "STAR-TZX2-TPWF")
|
||||||
# Pick a random array element. Scale a floating point number for
|
# Pick a random array element. Scale a floating point number for
|
||||||
# a more random distribution than simply calling RANDOM
|
# a more random distribution than simply calling RANDOM
|
||||||
random_code="${referral_codes[$(awk '{srand($2); print int(rand()*$1)}' <<< "${#referral_codes[@]} $RANDOM")]}"
|
random_code="${referral_codes[$(awk '{srand($2); print int(rand()*$1)}' <<< "${#referral_codes[@]} $RANDOM")]}"
|
||||||
@ -1563,20 +1598,6 @@ fi
|
|||||||
# Set defaults
|
# Set defaults
|
||||||
live_or_ptu="$live_dir"
|
live_or_ptu="$live_dir"
|
||||||
|
|
||||||
# Check if a newer verison of the script is available
|
|
||||||
latest_version="$(get_latest_release "$repo")"
|
|
||||||
|
|
||||||
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
|
|
||||||
releases_url_formatted="$releases_url"
|
|
||||||
fi
|
|
||||||
|
|
||||||
message info "The latest version of the LUG Helper is $latest_version\nYou are using $current_version\n\nYou can download new releases here:\n$releases_url_formatted"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If invoked with command line arguments, process them and exit
|
# If invoked with command line arguments, process them and exit
|
||||||
if [ "$#" -gt 0 ]; then
|
if [ "$#" -gt 0 ]; then
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -1587,6 +1608,7 @@ if [ "$#" -gt 0 ]; then
|
|||||||
printf "Star Citizen Linux Users Group Helper Script
|
printf "Star Citizen Linux Users Group Helper Script
|
||||||
Usage: lug-helper <options>
|
Usage: lug-helper <options>
|
||||||
-p, --preflight-check Run system optimization checks
|
-p, --preflight-check Run system optimization checks
|
||||||
|
-i, --install Install Star Citizen
|
||||||
-m, --manage-runners Install or remove Lutris runners
|
-m, --manage-runners Install or remove Lutris runners
|
||||||
-k, --manage-dxvk Install or remove DXVK versions
|
-k, --manage-dxvk Install or remove DXVK versions
|
||||||
-u, --delete-user-folder Delete Star Citizen USER folder, preserving keybinds
|
-u, --delete-user-folder Delete Star Citizen USER folder, preserving keybinds
|
||||||
@ -1603,6 +1625,9 @@ Usage: lug-helper <options>
|
|||||||
--preflight-check | -p )
|
--preflight-check | -p )
|
||||||
cargs+=("preflight_check")
|
cargs+=("preflight_check")
|
||||||
;;
|
;;
|
||||||
|
--install | -i )
|
||||||
|
cargs+=("install_game")
|
||||||
|
;;
|
||||||
--manage-runners | -m )
|
--manage-runners | -m )
|
||||||
cargs+=("runner_manage")
|
cargs+=("runner_manage")
|
||||||
;;
|
;;
|
||||||
@ -1671,6 +1696,22 @@ Usage: lug-helper <options>
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Format some URLs for Zenity
|
||||||
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
|
releases_url="<a href='$releases_url'>$releases_url</a>"
|
||||||
|
lug_wiki="<a href='$lug_wiki'>$lug_wiki</a>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if a newer verison of the script is available
|
||||||
|
latest_version="$(get_latest_release "$repo")"
|
||||||
|
|
||||||
|
# Sort the versions and check if the installed Helper is smaller
|
||||||
|
if [ "$latest_version" != "$current_version" ] &&
|
||||||
|
[ "$current_version" = "$(printf "$current_version\n$latest_version" | sort -V | head -n1)" ]; then
|
||||||
|
|
||||||
|
message info "The latest version of the LUG Helper is $latest_version\nYou are using $current_version\n\nYou can download new releases here:\n$releases_url"
|
||||||
|
fi
|
||||||
|
|
||||||
# Loop the main menu until the user selects quit
|
# Loop the main menu until the user selects quit
|
||||||
while true; do
|
while true; do
|
||||||
# Configure the menu
|
# Configure the menu
|
||||||
|
@ -80,11 +80,12 @@
|
|||||||
"dxvk": true,
|
"dxvk": true,
|
||||||
"esync": true,
|
"esync": true,
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"nvapi,nvapi64": "disabled"
|
"nvapi,nvapi64": "disabled",
|
||||||
},
|
"libglesv2": "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"
|
"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 libglesv2: disabled\n"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user