mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-01 16:00:35 +00:00
Compare commits
73 Commits
v1.14
...
1b334db7cc
Author | SHA1 | Date | |
---|---|---|---|
1b334db7cc | |||
dc648a8f6f | |||
7426d0ffb3 | |||
1cb9eb6488 | |||
a8c4257430 | |||
b2f542e029 | |||
17b1bfe140 | |||
f19faa8235 | |||
7cc4cca62d | |||
8f857476d0 | |||
652c2fa4a0 | |||
6e4feecc85 | |||
0e5fe688eb | |||
8d130668d6 | |||
142e09800f | |||
1ae94e9b50 | |||
747c799a8b | |||
ba907c44bf | |||
e7a3b30564 | |||
38e646578a | |||
d0dc44dcd9 | |||
9986f1fe8c | |||
bc11c184d2 | |||
02a79aa859 | |||
2eabf019a6 | |||
bdb71475a8 | |||
c627666705 | |||
65ac8ae4cd | |||
b4d9598fe5 | |||
dd81f24be3 | |||
f99fe9b996 | |||
dffa971dc1 | |||
fe1733542d | |||
d6d28f1481 | |||
eb48d00396 | |||
f072378617 | |||
d6376ff9fa | |||
28051a135a | |||
44b1332782 | |||
10c5438189 | |||
57df0a8dd9 | |||
f67c76be2e | |||
d9d58702d1 | |||
3d6e4cc367 | |||
3932fd2754 | |||
314a1ff5ea | |||
26f1377506 | |||
b71f601547 | |||
717a83a512 | |||
ae25785a41 | |||
2f45058e58 | |||
33b8643d47 | |||
faa047546b | |||
5ef3a95a2a | |||
37e487d296 | |||
ab9155b9b8 | |||
7b7347dd64 | |||
9a2c064a06 | |||
6ef58adc12 | |||
3b3abbe8ea | |||
da1fc66571 | |||
bc5d5c4a9b | |||
deb84dd757 | |||
fc70cdc687 | |||
21444076de | |||
4b32177e97 | |||
b4762d4724 | |||
37c94af2ed | |||
6d56599e2f | |||
9909221dff | |||
a328b465ef | |||
8e28327e0f | |||
156a0884d4 |
26
README.md
26
README.md
@ -1,4 +1,4 @@
|
||||
# LUG-Helper
|
||||
# LUG Helper
|
||||
**Star Citizen's Linux Users Group Helper Script**
|
||||
https://robertsspaceindustries.com/orgs/LUG
|
||||
|
||||
@ -8,7 +8,7 @@ _**This script is designed to help you manage and optimize Star Citizen on Linux
|
||||
Zenity menus are used for a GUI experience with a fallback to terminal-based menus where Zenity is unavailable.
|
||||
Command line arguments are available for quickly launching functions from the terminal.
|
||||
|
||||
Configuration is saved in *$XDG_CONFIG_HOME/starcitizen-lug/*.
|
||||
Configuration is saved in *$XDG_CONFIG_HOME/starcitizen-lug/*
|
||||
Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
|
||||
|
||||
## Options:
|
||||
@ -23,10 +23,13 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
|
||||
`Install Star Citizen`
|
||||
- Launches Lutris and uses the bundled json to install Star Citizen
|
||||
|
||||
`Deploy Easy Anti-Cheat Workaround`
|
||||
- Applies the workaround to /etc/hosts and deletes the necessary EAC files
|
||||
|
||||
`Manage Lutris Runners`
|
||||
- Quickly install and delete Lutris wine runners
|
||||
|
||||
`Manage DXVK Versions`
|
||||
`Manage Lutris DXVK Versions`
|
||||
- Quickly install and delete DXVK versions for Lutris
|
||||
|
||||
`Maintenance and Troubleshooting`
|
||||
@ -40,8 +43,8 @@ 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 folder only`
|
||||
- Sometimes all you need to do between major version updates is delete your shaders directory.
|
||||
- `Delete my shaders`
|
||||
- It is recommended to delete your shaders directory after each game update.
|
||||
|
||||
- `Delete my DXVK cache`
|
||||
- A troubleshooting step that sometimes helps fix various issues and crashes.
|
||||
@ -52,6 +55,9 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
|
||||
- `Reset Helper configs`
|
||||
- Delete the configs saved by the helper in *$XDG_CONFIG_HOME/starcitizen-lug/*
|
||||
|
||||
- `Show the LUG Wiki`
|
||||
- Display a link to the LUG Wiki for help with installation and troubleshooting
|
||||
|
||||
`Get a random Penguin's Star Citizen referral code`
|
||||
- Display a referral code for a random member of the Star Citizen Linux Users Group.
|
||||
|
||||
@ -60,16 +66,20 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
|
||||
## Installation:
|
||||
|
||||
From Source:
|
||||
1. Download it!
|
||||
2. Run it!
|
||||
3. If you want, move *lug-logo.png* to */usr/share/pixmaps/*
|
||||
1. Download it! https://github.com/starcitizen-lug/lug-helper/releases
|
||||
2. Extract it!
|
||||
3. Run it!
|
||||
|
||||
Arch Linux: https://aur.archlinux.org/packages/lug-helper/
|
||||
|
||||
_Dependencies: **bash**, **coreutils**, **curl**, **polkit** (these should be installed by default on most distributions)_
|
||||
_Optional Dependencies: **zenity** (for GUI), **zstd** (to extract some runners)_
|
||||
|
||||
## Contributors:
|
||||
- https://github.com/Termuellinator
|
||||
- https://github.com/pstn
|
||||
- https://github.com/gort818
|
||||
- https://github.com/victort
|
||||
- https://github.com/Wrzlprnft
|
||||
- https://github.com/ananace
|
||||
- Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater
|
||||
|
259
lug-helper.sh
259
lug-helper.sh
@ -65,6 +65,12 @@ 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 zstd)" ]; then
|
||||
# Print to stderr and also try warning the user through notify-send
|
||||
printf "lug-helper.sh: The package 'zstd' was not found on this system. It is required for extracting some runner packages.\n" 1>&2
|
||||
notify-send "lug-helper" "The package 'zstd' was not found on this system. It is required for extracting some runner packages.\n" --icon=dialog-warning
|
||||
exit 1
|
||||
fi
|
||||
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 coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\n" 1>&2
|
||||
@ -72,6 +78,8 @@ if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v sort)" ] || [ ! -x "$
|
||||
exit 1
|
||||
fi
|
||||
|
||||
######## Config ############################################################
|
||||
|
||||
wine_conf="winedir.conf"
|
||||
game_conf="gamedir.conf"
|
||||
|
||||
@ -83,7 +91,7 @@ data_dir="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||
conf_subdir="starcitizen-lug"
|
||||
|
||||
# Helper directory
|
||||
helper_dir="$(realpath "$0" | xargs dirname)"
|
||||
helper_dir="$(realpath "$0" | xargs -0 dirname)"
|
||||
|
||||
# Temporary directory
|
||||
tmp_dir="$(mktemp -d --suffix=".lughelper")"
|
||||
@ -100,6 +108,12 @@ install_path="drive_c/Program Files/Roberts Space Industries/$sc_base_dir"
|
||||
live_dir="LIVE"
|
||||
ptu_dir="PTU"
|
||||
|
||||
# Location in the WINE prefix where shaders are stored
|
||||
appdata_path="drive_c/users/$USER/AppData/Local/Star Citizen"
|
||||
|
||||
# The shaders subdirectory name
|
||||
shaders_subdir="shaders"
|
||||
|
||||
# Remaining directory paths are set at the end of the getdirs() function
|
||||
|
||||
######## Runners ###########################################################
|
||||
@ -113,7 +127,6 @@ runners_dir="$data_dir/lutris/runners/wine"
|
||||
# ie. "RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
||||
runner_sources=(
|
||||
"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"
|
||||
)
|
||||
@ -130,6 +143,7 @@ dxvk_dir="$data_dir/lutris/runtime/dxvk"
|
||||
dxvk_sources=(
|
||||
"Sporif Async" "https://api.github.com/repos/Sporif/dxvk-async/releases"
|
||||
"/dev/null" "https://api.github.com/repos/gort818/dxvk/releases"
|
||||
"gnusenpai" "https://api.github.com/repos/gnusenpai/dxvk/releases"
|
||||
)
|
||||
|
||||
# Set a maximum number of versions to display from each download url
|
||||
@ -139,7 +153,7 @@ max_download_items=20
|
||||
# used to dynamically determine the height of menus
|
||||
menu_option_height="25"
|
||||
|
||||
############################################################################
|
||||
######## Bundled Files #####################################################
|
||||
|
||||
# Use logo installed by a packaged version of this script if available
|
||||
# Otherwise, default to the logo in the same directory
|
||||
@ -151,16 +165,23 @@ else
|
||||
lug_logo="info"
|
||||
fi
|
||||
|
||||
# Lutris install script
|
||||
install_script="$helper_dir/lug-lutris-install.json"
|
||||
# Use Lutris install script installed by a packaged version of this script if available
|
||||
# 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
|
||||
repo="starcitizen-lug/lug-helper"
|
||||
releases_url="https://github.com/$repo/releases"
|
||||
current_version="v1.14"
|
||||
|
||||
# LUG Wiki
|
||||
lug_wiki="https://github.com/starcitizen-lug/information-howtos/wiki"
|
||||
current_version="v1.22"
|
||||
|
||||
############################################################################
|
||||
############################################################################
|
||||
@ -214,17 +235,17 @@ message() {
|
||||
"info")
|
||||
# info message
|
||||
# call format: message info "text to display"
|
||||
margs=("--info" "--window-icon=$lug_logo" "--no-wrap" "--text=")
|
||||
margs=("--info" "--window-icon=\"$lug_logo\"" "--no-wrap" "--text=")
|
||||
;;
|
||||
"warning")
|
||||
# warning message
|
||||
# call format: message warning "text to display"
|
||||
margs=("--warning" "--window-icon=$lug_logo" "--text=")
|
||||
margs=("--warning" "--window-icon=\"$lug_logo\"" "--text=")
|
||||
;;
|
||||
"question")
|
||||
# question
|
||||
# call format: if message question "question to ask?"; then...
|
||||
margs=("--question" "--window-icon=$lug_logo" "--text=")
|
||||
margs=("--question" "--window-icon=\"$lug_logo\"" "--text=")
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Script Error: Invalid message type passed to the message function. Aborting."
|
||||
@ -335,9 +356,9 @@ menu() {
|
||||
zen_options+=("${menu_options[i]}")
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Display the zenity radio button menu
|
||||
choice="$(zenity --list --radiolist --width="480" --height="$menu_height" --text="$menu_text_zenity" --title="Star Citizen LUG Helper" --hide-header --cancel-label "$cancel_label" --window-icon=$lug_logo --column="" --column="Option" "${zen_options[@]}" 2>/dev/null)"
|
||||
choice="$(zenity --list --radiolist --width="480" --height="$menu_height" --text="$menu_text_zenity" --title="Star Citizen LUG Helper" --hide-header --cancel-label "$cancel_label" --window-icon="$lug_logo" --column="" --column="Option" "${zen_options[@]}" 2>/dev/null)"
|
||||
|
||||
# Loop through the options array to match the chosen option
|
||||
matched="false"
|
||||
@ -451,7 +472,7 @@ getdirs() {
|
||||
message warning "An unexpected error has occurred. The Helper is unable to proceed."
|
||||
return 1
|
||||
elif [ "$(basename "$game_path")" != "$sc_base_dir" ]; then
|
||||
message warning "You must select the Star Citizen base game directory.\n\nFor Example: prefix/drive_c/Program Files/Roberts Space Industries/StarCitizen"
|
||||
message warning "You must select the base game directory named '$sc_base_dir'\n\nie. [prefix]/drive_c/Program Files/Roberts Space Industries/StarCitizen"
|
||||
else
|
||||
# All good or cancel
|
||||
break
|
||||
@ -515,7 +536,7 @@ getdirs() {
|
||||
# The location within the USER directory to which the game exports keybinds
|
||||
keybinds_dir="$user_dir/Controls/Mappings"
|
||||
# Shaders directory
|
||||
shaders_dir="$user_dir/shaders"
|
||||
shaders_dir="$wine_prefix/$appdata_path"
|
||||
# dxvk cache file
|
||||
dxvk_cache="$game_path/$live_or_ptu/StarCitizen.dxvk-cache"
|
||||
# Where to store backed up keybinds
|
||||
@ -524,6 +545,8 @@ getdirs() {
|
||||
|
||||
# Display all directories currently used by this helper and Star Citizen
|
||||
display_dirs() {
|
||||
declare -a dirs_list
|
||||
|
||||
# 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")
|
||||
@ -539,6 +562,11 @@ display_dirs() {
|
||||
dirs_list+="\n\nStar Citizen game directory:\n$(cat "$conf_dir/$conf_subdir/$game_conf")"
|
||||
fi
|
||||
|
||||
# Star Citizen shaders path
|
||||
if [ -f "$conf_dir/$conf_subdir/$wine_conf" ]; then
|
||||
dirs_list+="\n\nStar Citizen shaders:\n$(cat "$conf_dir/$conf_subdir/$wine_conf")/$appdata_path"
|
||||
fi
|
||||
|
||||
# Lutris runners
|
||||
if [ -d "$runners_dir" ]; then
|
||||
dirs_list+="\n\nLutris Runners:\n$runners_dir"
|
||||
@ -549,7 +577,7 @@ display_dirs() {
|
||||
dirs_list+="\n\nLutris DXVK Versions:\n$dxvk_dir"
|
||||
fi
|
||||
|
||||
# Formatting
|
||||
# Format the info header
|
||||
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>"
|
||||
@ -559,7 +587,7 @@ display_dirs() {
|
||||
}
|
||||
|
||||
# Save exported keybinds, wipe the USER directory, and restore keybinds
|
||||
sanitize() {
|
||||
rm_userdir() {
|
||||
# Prompt user to back up the current keybinds in the game
|
||||
message info "Before proceeding, please be sure you have exported\nyour Star Citizen keybinds from within the game.\n\nTo do this, launch the game and go to:\nOptions->Keybindings->Control Profiles->Save Control Settings\n\nGo on; I'll wait."
|
||||
|
||||
@ -632,8 +660,8 @@ mapcount_once() {
|
||||
mapcount_set() {
|
||||
if [ -d "/etc/sysctl.d" ]; then
|
||||
# Newer versions of sysctl
|
||||
preflight_actions+=('printf "\n# Added by LUG-Helper:\nvm.max_map_count = 16777216\n" >> /etc/sysctl.d/20-max_map_count.conf && sysctl --system')
|
||||
preflight_results+=("The vm.max_map_count configuration has been appended to:\n/etc/sysctl.d/20-max_map_count.conf")
|
||||
preflight_actions+=('printf "\n# Added by LUG-Helper:\nvm.max_map_count = 16777216\n" > /etc/sysctl.d/20-starcitizen-max_map_count.conf && sysctl --system')
|
||||
preflight_results+=("The vm.max_map_count configuration has been appended to:\n/etc/sysctl.d/20-starcitizen-max_map_count.conf")
|
||||
else
|
||||
# Older versions of sysctl
|
||||
preflight_actions+=('printf "\n# Added by LUG-Helper:\nvm.max_map_count = 16777216" >> /etc/sysctl.conf && sysctl -p')
|
||||
@ -668,7 +696,7 @@ mapcount_check() {
|
||||
# Add info for manually changing the setting
|
||||
if [ -d "/etc/sysctl.d" ]; then
|
||||
# Newer versions of sysctl
|
||||
preflight_manual+=("To change vm.max_map_count permanently, add the following line to\n'/etc/sysctl.d/20-max_map_count.conf' and reload with 'sudo sysctl --system':\n vm.max_map_count = 16777216\n\nOr, to change vm.max_map_count temporarily until next boot, run:\n sudo sysctl -w vm.max_map_count=16777216")
|
||||
preflight_manual+=("To change vm.max_map_count permanently, add the following line to\n'/etc/sysctl.d/20-starcitizen-max_map_count.conf' and reload with 'sudo sysctl --system'\n vm.max_map_count = 16777216\n\nOr, to change vm.max_map_count temporarily until next boot, run:\n sudo sysctl -w vm.max_map_count=16777216")
|
||||
else
|
||||
# Older versions of sysctl
|
||||
preflight_manual+=("To change vm.max_map_count permanently, add the following line to\n'/etc/sysctl.conf' and reload with 'sudo sysctl -p':\n vm.max_map_count = 16777216\n\nOr, to change vm.max_map_count temporarily until next boot, run:\n sudo sysctl -w vm.max_map_count=16777216")
|
||||
@ -692,8 +720,8 @@ filelimit_set() {
|
||||
if [ -f "/etc/systemd/system.conf" ]; then
|
||||
# Using systemd
|
||||
# Append to the file
|
||||
preflight_actions+=('printf "\n# Added by LUG-Helper:\nDefaultLimitNOFILE=524288\n" >> /etc/systemd/system.conf && systemctl daemon-reexec')
|
||||
preflight_results+=("The open files limit configuration has been appended to:\n/etc/systemd/system.conf")
|
||||
preflight_actions+=('mkdir -p /etc/systemd/system.conf.d && printf "[Manager]\n# Added by LUG-Helper:\nDefaultLimitNOFILE=524288\n" > /etc/systemd/system.conf.d/20-starcitizen-filelimit.conf && systemctl daemon-reexec')
|
||||
preflight_results+=("The open files limit configuration has been added to:\n/etc/systemd/system.conf.d/20-starcitizen-filelimit.conf")
|
||||
elif [ -f "/etc/security/limits.conf" ]; then
|
||||
# Using limits.conf
|
||||
# Insert before the last line in the file
|
||||
@ -725,7 +753,7 @@ filelimit_check() {
|
||||
# Add info for manually changing the settings
|
||||
if [ -f "/etc/systemd/system.conf" ]; then
|
||||
# Using systemd
|
||||
preflight_manual+=("To change your open file descriptors limit, add the following line to\n'/etc/systemd/system.conf':\n DefaultLimitNOFILE=524288")
|
||||
preflight_manual+=("To change your open file descriptors limit, add the following to\n'/etc/systemd/system.conf.d/20-starcitizen-filelimit.conf':\n\n[Manager]\nDefaultLimitNOFILE=524288")
|
||||
elif [ -f "/etc/security/limits.conf" ]; then
|
||||
# Using limits.conf
|
||||
preflight_manual+=("To change your open file descriptors limit, add the following line to\n'/etc/security/limits.conf':\n * hard nofile 524288")
|
||||
@ -766,6 +794,15 @@ avx_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if swap is set up
|
||||
swap_check() {
|
||||
if cat /proc/swaps | grep -vq "Filename"; then
|
||||
preflight_pass+=("You have swap space configured.")
|
||||
else
|
||||
preflight_fail+=("You don't appear to have swap space configured.\nWe recommend configuring an 8-16 GB swap file.")
|
||||
fi
|
||||
}
|
||||
|
||||
# Check that the system is optimized for Star Citizen
|
||||
preflight_check() {
|
||||
# Initialize variables
|
||||
@ -780,6 +817,7 @@ preflight_check() {
|
||||
# Call the optimization functions to perform the checks
|
||||
wine_check
|
||||
memory_check
|
||||
swap_check
|
||||
avx_check
|
||||
mapcount_check
|
||||
filelimit_check
|
||||
@ -881,10 +919,10 @@ preflight_check() {
|
||||
|
||||
# Restart lutris if necessary
|
||||
lutris_restart() {
|
||||
if [ "$lutris_needs_restart" = "true" ] && [ "$(pgrep lutris)" ]; then
|
||||
if [ "$lutris_needs_restart" = "true" ] && [ "$(pgrep -f lutris)" ]; 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 &
|
||||
pkill -f -SIGTERM lutris && nohup lutris </dev/null &>/dev/null &
|
||||
fi
|
||||
fi
|
||||
lutris_needs_restart="false"
|
||||
@ -893,6 +931,7 @@ lutris_restart() {
|
||||
# Perform post-download actions, display messages or instructions
|
||||
# Expects the variables message_heading, post_download_msg_text,
|
||||
# post_download_msg_italics, and downloaded_item_name
|
||||
# Optional: post_download_msg_more_info and post_download_msg_link
|
||||
post_download() {
|
||||
# Check if lutris needs to be restarted after making changes
|
||||
lutris_restart
|
||||
@ -900,12 +939,30 @@ post_download() {
|
||||
if [ "$display_post_download_msg" = "true" ]; then
|
||||
message_heading="Download Complete"
|
||||
|
||||
# Format some variables for zenity
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
message_heading="<b>$message_heading</b>"
|
||||
post_download_msg_italics="<i>$post_download_msg_italics</i>"
|
||||
|
||||
# If we have a link to provide, format it as well
|
||||
if [ -n "$post_download_msg_link" ]; then
|
||||
post_download_msg_link="<a href='$post_download_msg_link'>$post_download_msg_link</a>"
|
||||
fi
|
||||
fi
|
||||
message info "$message_heading\n\n$post_download_msg_text\n$post_download_msg_italics\n\n$downloaded_item_name"
|
||||
|
||||
# Add newlines to the optional variables if set
|
||||
if [ -n "$post_download_msg_more_info" ]; then
|
||||
post_download_msg_more_info="\n\n$post_download_msg_more_info"
|
||||
fi
|
||||
if [ -n "$post_download_msg_link" ]; then
|
||||
post_download_msg_link="\n$post_download_msg_link"
|
||||
fi
|
||||
|
||||
# Display the info
|
||||
message info "$message_heading\n\n$post_download_msg_text\n$post_download_msg_italics\n\n$downloaded_item_name$post_download_msg_more_info$post_download_msg_link"
|
||||
fi
|
||||
|
||||
# Reset
|
||||
display_post_download_msg="false"
|
||||
}
|
||||
|
||||
@ -992,11 +1049,20 @@ download_install() {
|
||||
*.tar.xz)
|
||||
download_name="$(basename "$download_file" .tar.xz)"
|
||||
;;
|
||||
*.tar.zst)
|
||||
download_name="$(basename "$download_file" .tar.zst)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in download_install function. Aborting."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check if this file has already been installed
|
||||
if [ -d "$download_dir/$download_name" ]; then
|
||||
message info "The selected $download_type is already installed:\n\n$download_name"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Get the selected download url
|
||||
# To add new sources, handle them here and in the
|
||||
# download_select_install function below
|
||||
@ -1116,6 +1182,7 @@ download_install() {
|
||||
# Cleanup tmp download
|
||||
debug_print continue "Cleaning up $tmp_dir/$download_file..."
|
||||
rm "$tmp_dir/$download_file"
|
||||
rm -r "$tmp_dir/$download_name"
|
||||
}
|
||||
|
||||
# List available items for download
|
||||
@ -1141,13 +1208,15 @@ download_select_install() {
|
||||
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# 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" ] || [ "$contributor_name" = "TKG" ] ); then
|
||||
required_glibc="2.33"
|
||||
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"
|
||||
return 1
|
||||
fi
|
||||
@ -1157,7 +1226,7 @@ download_select_install() {
|
||||
# To add new sources, handle them here, in the if statement
|
||||
# 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))
|
||||
download_versions=($(curl -s "$contributor_url" | awk '/browser_download_url/ {print $2}' | xargs basename -a))
|
||||
else
|
||||
debug_print exit "Script error: Unknown api/url format in ${download_type}_sources array. Aborting."
|
||||
fi
|
||||
@ -1180,9 +1249,13 @@ download_select_install() {
|
||||
# and add them to the menu options
|
||||
# To add new file extensions, handle them here and in
|
||||
# the download_install function above
|
||||
for (( i=0; i<"$max_download_items" && i<"${#download_versions[@]}"; i++ )); do
|
||||
for (( i=0,num_download_items=0; i<"${#download_versions[@]}" && "$num_download_items"<"$max_download_items"; i++ )); do
|
||||
# Get the file name minus the extension
|
||||
case "${download_versions[i]}" in
|
||||
*.sha*sum | *.ini | proton*)
|
||||
# Ignore hashes, configs, and proton downloads
|
||||
continue
|
||||
;;
|
||||
*.tar.gz)
|
||||
download_name="$(basename "${download_versions[i]}" .tar.gz)"
|
||||
;;
|
||||
@ -1191,9 +1264,14 @@ download_select_install() {
|
||||
;;
|
||||
*.tar.xz)
|
||||
download_name="$(basename "${download_versions[i]}" .tar.xz)"
|
||||
;;
|
||||
;;
|
||||
*.tar.zst)
|
||||
download_name="$(basename "${download_versions[i]}" .tar.zst)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in download_select_install function. Aborting."
|
||||
# Print a warning and move on to the next item
|
||||
debug_print continue "Warning: Unknown archive filetype in download_select_install() function. Offending String: ${download_versions[i]}"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -1204,8 +1282,11 @@ download_select_install() {
|
||||
menu_options+=("$download_name")
|
||||
fi
|
||||
menu_actions+=("download_install $i")
|
||||
done
|
||||
|
||||
# Increment the added items counter
|
||||
num_download_items="$(($num_download_items+1))"
|
||||
done
|
||||
|
||||
# Complete the menu by adding the option to go back to the previous menu
|
||||
menu_options+=("$goback")
|
||||
menu_actions+=(":") # no-op
|
||||
@ -1254,7 +1335,7 @@ download_manage() {
|
||||
return 0
|
||||
fi
|
||||
if [ ! -d "$download_dir" ]; then
|
||||
message info "Lutris $download_type directory not found. Unable to continue.\n\n$download_dir"
|
||||
message info "The following Lutris directory was not found. Unable to continue.\n\n$download_dir"
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -1323,9 +1404,13 @@ runner_manage() {
|
||||
# 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
|
||||
# Then, the downloaded directory name is automatically displayed
|
||||
# Optional variables post_download_msg_more_info and
|
||||
# post_download_msg_link will be displayed if set
|
||||
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_more_info=""
|
||||
post_download_msg_link=""
|
||||
|
||||
# Call the download_manage function with the above configuration
|
||||
# The argument passed to the function is used for special handling
|
||||
@ -1345,8 +1430,8 @@ dxvk_manage() {
|
||||
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_heading="Lutris DXVK Versions"
|
||||
download_menu_description="The DXVK versions below may help reduce stuttering"
|
||||
download_menu_height="140"
|
||||
|
||||
# Set the post download instructions
|
||||
@ -1354,9 +1439,13 @@ dxvk_manage() {
|
||||
# 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
|
||||
# Then, the downloaded directory name is automatically displayed
|
||||
# Optional variables post_download_msg_more_info and
|
||||
# post_download_msg_link will be displayed if set
|
||||
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_more_info="See our wiki for instructions on setting the DXVK_ASYNC environment variable in Lutris:"
|
||||
post_download_msg_link="https://github.com/starcitizen-lug/information-howtos/wiki/Performance-Tuning#dxvk-async"
|
||||
|
||||
# Call the download_manage function with the above configuration
|
||||
# The argument passed to the function is used for special handling
|
||||
@ -1380,9 +1469,13 @@ eac_workaround() {
|
||||
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!"
|
||||
# Check if EAC workaround is already applied
|
||||
if grep -q "$eac_hosts" /etc/hosts; then
|
||||
if grep -q "^$eac_hosts" /etc/hosts; then
|
||||
message info "The Easy Anti-Cheat workaround has already been applied.\nYou're all set!"
|
||||
else
|
||||
message info "The Easy Anti-Cheat workaround has already been applied, but may be commented out.\nNo changes have been made, please edit /etc/hosts manually."
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
|
||||
@ -1406,8 +1499,11 @@ eac_workaround() {
|
||||
sudo sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||
fi
|
||||
|
||||
debug_print continue "Deleting $eac_dir..."
|
||||
rm -r "$eac_dir"
|
||||
# Delete the EAC directory if it exists
|
||||
if [ -d "$eac_dir" ]; then
|
||||
debug_print continue "Deleting $eac_dir..."
|
||||
rm -r "$eac_dir"
|
||||
fi
|
||||
|
||||
message info "Easy Anti-Cheat workaround has been deployed!"
|
||||
fi
|
||||
@ -1432,6 +1528,12 @@ install_game() {
|
||||
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
|
||||
@ -1441,18 +1543,18 @@ rm_shaders() {
|
||||
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
|
||||
# Loop through all possible shader directories
|
||||
for appdata_dir in "$shaders_dir"/*; do
|
||||
if [ -d "$appdata_dir/$shaders_subdir" ]; then
|
||||
# If a shaders directory is found, delete it
|
||||
if message question "The following directory will be deleted:\n\n$appdata_dir/$shaders_subdir\n\nDo you want to proceed?"; then
|
||||
debug_print continue "Deleting $appdata_dir/$shaders_subdir..."
|
||||
rm -r "$appdata_dir/$shaders_subdir"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# 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
|
||||
message info "All shaders have been deleted"
|
||||
}
|
||||
|
||||
# Delete DXVK cache
|
||||
@ -1491,17 +1593,18 @@ maintenance_menu() {
|
||||
|
||||
# Configure the menu options
|
||||
version_msg="Switch the Helper between LIVE and PTU (Currently: $live_or_ptu)"
|
||||
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)"
|
||||
userdir_msg="Delete my Star Citizen USER folder and preserve my keybinds"
|
||||
shaders_msg="Delete my shaders (Do this after each game update)"
|
||||
vidcache_msg="Delete my DXVK cache"
|
||||
dirs_msg="Display Helper and Star Citizen directories"
|
||||
wiki_msg="Show the LUG Wiki"
|
||||
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" "$dirs_msg" "$reset_msg" "$quit_msg")
|
||||
menu_options=("$version_msg" "$userdir_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
|
||||
menu_actions=("set_version" "sanitize" "rm_shaders" "rm_dxvkcache" "display_dirs" "reset_helper" "menu_loop_done")
|
||||
menu_actions=("set_version" "rm_userdir" "rm_shaders" "rm_dxvkcache" "display_dirs" "display_wiki" "reset_helper" "menu_loop_done")
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
@ -1517,7 +1620,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" "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")
|
||||
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" "STAR-WCHN-4ZMX")
|
||||
# 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")]}"
|
||||
@ -1580,20 +1683,6 @@ fi
|
||||
# Set defaults
|
||||
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 [ "$#" -gt 0 ]; then
|
||||
while [ "$#" -gt 0 ]
|
||||
@ -1631,7 +1720,7 @@ Usage: lug-helper <options>
|
||||
cargs+=("dxvk_manage")
|
||||
;;
|
||||
--delete-user-folder | -u )
|
||||
cargs+=("sanitize")
|
||||
cargs+=("rm_userdir")
|
||||
;;
|
||||
--delete-shaders | -s )
|
||||
cargs+=("rm_shaders")
|
||||
@ -1692,6 +1781,22 @@ Usage: lug-helper <options>
|
||||
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
|
||||
while true; do
|
||||
# Configure the menu
|
||||
@ -1704,7 +1809,7 @@ while true; do
|
||||
install_msg="Install Star Citizen"
|
||||
eac_msg="Deploy Easy Anti-Cheat Workaround"
|
||||
runners_msg="Manage Lutris Runners"
|
||||
dxvk_msg="Manage DXVK Versions"
|
||||
dxvk_msg="Manage Lutris DXVK Versions"
|
||||
maintenance_msg="Maintenance and Troubleshooting"
|
||||
randomizer_msg="Get a random Penguin's Star Citizen referral code"
|
||||
quit_msg="Quit"
|
||||
|
@ -30,7 +30,7 @@
|
||||
"script": {
|
||||
"files": [
|
||||
{
|
||||
"client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.5.4.exe"
|
||||
"client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.5.5.exe"
|
||||
}
|
||||
],
|
||||
"game": {
|
||||
@ -80,11 +80,12 @@
|
||||
"dxvk": true,
|
||||
"esync": true,
|
||||
"overrides": {
|
||||
"nvapi,nvapi64": "disabled"
|
||||
},
|
||||
"nvapi,nvapi64": "disabled",
|
||||
"libglesv2": "builtin"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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.5.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: builtin\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user