60 Commits

Author SHA1 Message Date
26f1377506 Fix helper directory paths with spaces 2022-02-09 16:22:02 -05:00
b71f601547 Bump version 2022-02-05 12:27:47 -05:00
717a83a512 Improve EAC workaround 2022-02-05 12:27:05 -05:00
ae25785a41 Bump version 2022-02-04 23:27:07 -05:00
2f45058e58 Update launcher to v1.5.5 2022-02-04 23:21:40 -05:00
33b8643d47 Update README.md 2022-02-01 16:33:17 -05:00
faa047546b Update README.md 2022-01-21 18:20:30 -05:00
5ef3a95a2a Consistency in systemd drop-in filenames 2022-01-21 18:11:32 -05:00
37e487d296 Use systemd drop-in for setting filelimit 2022-01-21 17:43:58 -05:00
ab9155b9b8 Clarify that DXVK manager is for Lutris 2022-01-21 17:20:44 -05:00
7b7347dd64 Clarify error message 2022-01-19 02:20:17 -05:00
9a2c064a06 Update README.md 2022-01-14 19:22:04 -05:00
6ef58adc12 Update README.md 2022-01-14 19:21:36 -05:00
3b3abbe8ea Update README.md 2022-01-14 19:21:17 -05:00
da1fc66571 Update README.md 2022-01-10 13:50:37 -05:00
bc5d5c4a9b Update README.md 2022-01-10 13:49:48 -05:00
deb84dd757 Merge pull request #28 from ananace/fix-white-launcher
Add libglesv2 override to fix white launcher window
2022-01-10 13:42:54 -05:00
fc70cdc687 Update README.md 2022-01-10 12:57:39 -05:00
21444076de Add libglesv2 override to fix white launcher
Would also work with launch arguments e.g. --use-gl=osmesa - but that
doesn't work when the launcher auto-updates, since it'll relaunch
without the launch arguments specified in Lutris
2022-01-08 12:18:14 +01:00
4b32177e97 Clickable wiki URL what an idea 2022-01-07 15:55:56 -05:00
b4762d4724 Add comments 2022-01-07 14:30:38 -05:00
37c94af2ed Bump version 2022-01-07 14:26:24 -05:00
6d56599e2f Add comment 2022-01-07 14:23:43 -05:00
9909221dff Remove bc dependency 2022-01-07 14:22:59 -05:00
a328b465ef Add display wiki option in troubleshooting menu 2022-01-06 21:08:01 -05:00
8e28327e0f added /usr/share/lug-helper path for lutris json for easier packaging 2022-01-06 15:10:10 +01:00
156a0884d4 added /usr/share/lug-helper path for lutris json for easier packaging 2022-01-06 15:05:24 +01:00
809efb6a54 Add more referral codes! 2022-01-01 21:51:13 -05:00
5afa8e7c19 Improve post download handling 2022-01-01 16:12:14 -05:00
49079818f6 Rearrange some functions 2022-01-01 15:52:53 -05:00
227038a289 Check for installed wine in the pre-flight check 2022-01-01 15:37:51 -05:00
8f53957f3c Improve messages 2022-01-01 15:17:07 -05:00
662d78a021 Add install to command line arguments 2022-01-01 13:03:09 -05:00
d10a84c5fe Yet -_- 2022-01-01 12:56:13 -05:00
35e63f5bd5 Clarify messaging 2022-01-01 12:49:07 -05:00
f3166c77da Integrate EAC workaround from eac branch
Seems like it's going to take them a while to fix it, so
2021-12-29 18:11:33 -05:00
707211962f Rename starcitizen-lutris-install.json to lug-lutris-install.json 2021-12-28 15:59:13 -05:00
5df5cb210d Update lutris install json filename 2021-12-28 15:58:52 -05:00
bf36fc96a9 Update README.md 2021-12-28 15:42:30 -05:00
702c678716 Upload Lutris install json 2021-12-28 15:41:32 -05:00
dedefebd2d Add installer using a bundled lutris json 2021-12-28 15:40:45 -05:00
d24e8b590b Bump version 2021-12-24 14:46:38 -05:00
3daeb0b3b1 Update lug-helper.sh
fixed raw-wine repo path
2021-12-24 02:01:11 +01:00
e8c93196ff Specify license 2021-12-21 19:52:32 -05:00
1561e1a9f6 Bump version 2021-11-27 20:28:40 -05:00
a0110720f6 Improve version checker 2021-11-27 20:28:11 -05:00
c1af0383f2 Bump version number 2021-11-27 00:27:41 -05:00
74c5bd2275 Add dxvk manager to command line arguments
Fixes #25
2021-11-27 00:17:24 -05:00
48d49dd438 Update repo url 2021-11-25 14:08:23 -05:00
f080ae2bca Fix syntax 2021-11-21 21:24:57 -05:00
72677ff7d5 Additional referral code 2021-11-19 10:58:49 -05:00
42f9992abf Revert EAC workaround on master branch
Track changes in a dedicated branch
2021-11-16 12:57:17 -05:00
786e3f4c13 Easy Anti-Cheat workaround 2021-11-16 12:49:09 -05:00
08285946c8 Add more referral codes 2021-11-14 17:24:52 -05:00
dafc53615d Display actual mapcount and file limits on system 2021-11-14 12:13:10 -05:00
3f72676c71 Additional referral code 2021-11-11 23:40:24 -05:00
3d7702dfdd Additional referral code 2021-11-11 09:53:39 -05:00
7ae0bcf330 Add additional referral code 2021-11-10 15:05:25 -05:00
8ce1a9a8ea Use better variable names 2021-11-10 15:04:48 -05:00
431df4aabd Corrected debug message 2021-11-08 12:57:00 +01:00
3 changed files with 444 additions and 227 deletions

View File

@ -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
@ -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. 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. 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/* Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
## Options: ## Options:
@ -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. - 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. - 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
`Deploy Easy Anti-Cheat Workaround`
- Applies the workaround to /etc/hosts and deletes the necessary EAC files
`Manage Lutris Runners` `Manage Lutris Runners`
- Quickly install and delete Lutris wine runners - Quickly install and delete Lutris wine runners
`Manage DXVK Versions` `Manage Lutris DXVK Versions`
- Quickly install and delete DXVK versions for Lutris - Quickly install and delete DXVK versions for Lutris
`Maintenance and Troubleshooting` `Maintenance and Troubleshooting`
@ -59,7 +65,6 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
From Source: From Source:
1. Download it! 1. Download it!
2. Run it! 2. Run it!
3. If you want, move *lug-logo.png* to */usr/share/pixmaps/*
Arch Linux: https://aur.archlinux.org/packages/lug-helper/ Arch Linux: https://aur.archlinux.org/packages/lug-helper/
@ -69,4 +74,5 @@ Arch Linux: https://aur.archlinux.org/packages/lug-helper/
- https://github.com/gort818 - https://github.com/gort818
- https://github.com/victort - https://github.com/victort
- https://github.com/Wrzlprnft - https://github.com/Wrzlprnft
- https://github.com/ananace
- Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater - Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater

View File

@ -15,6 +15,8 @@
# - Check your system for optimal settings and # - Check your system for optimal settings and
# change them as needed to prevent crashes. # change them as needed to prevent crashes.
# #
# - Install Star Citizen using a bundled Lutris install script
#
# - Easily install and remove Lutris wine Runners and DXVK versions. # - Easily install and remove Lutris wine Runners and DXVK versions.
# #
# - Qickly wipe your Star Citizen USER folder as is recommended # - Qickly wipe your Star Citizen USER folder as is recommended
@ -46,6 +48,8 @@
# Contributor: https://github.com/Wrzlprnft # Contributor: https://github.com/Wrzlprnft
# Runner Downloader inspired by: # Runner Downloader inspired by:
# https://github.com/richardtatum/sc-runner-updater # https://github.com/richardtatum/sc-runner-updater
#
# License: GPLv3.0
############################################################################ ############################################################################
# Check if script is run as root # Check if script is run as root
@ -61,13 +65,15 @@ if [ ! -x "$(command -v curl)" ]; then
notify-send "lug-helper" "The required package 'curl' was not found on this system.\n" --icon=dialog-warning notify-send "lug-helper" "The required package 'curl' was not found on this system.\n" --icon=dialog-warning
exit 1 exit 1
fi 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 # 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 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 packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)\n" --icon=dialog-warning 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 exit 1
fi fi
######## Config ############################################################
wine_conf="winedir.conf" wine_conf="winedir.conf"
game_conf="gamedir.conf" game_conf="gamedir.conf"
@ -78,6 +84,9 @@ data_dir="${XDG_DATA_HOME:-$HOME/.local/share}"
# .config subdirectory # .config subdirectory
conf_subdir="starcitizen-lug" conf_subdir="starcitizen-lug"
# Helper directory
helper_dir="$(realpath "$0" | xargs -0 dirname)"
# Temporary directory # Temporary directory
tmp_dir="$(mktemp -d --suffix=".lughelper")" tmp_dir="$(mktemp -d --suffix=".lughelper")"
trap 'rm -r "$tmp_dir"' EXIT trap 'rm -r "$tmp_dir"' EXIT
@ -105,7 +114,7 @@ runners_dir="$data_dir/lutris/runners/wine"
# The second is expected to contain the github api releases url # The second is expected to contain the github api releases url
# ie. "RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases" # ie. "RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
runner_sources=( 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" "Molotov/Snatella" "https://api.github.com/repos/snatella/wine-runner-sc/releases"
"/dev/null" "https://api.github.com/repos/gort818/wine-sc-lug/releases" "/dev/null" "https://api.github.com/repos/gort818/wine-sc-lug/releases"
"GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases" "GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases"
@ -132,22 +141,35 @@ 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
if [ -f "/usr/share/pixmaps/lug-logo.png" ]; then if [ -f "/usr/share/pixmaps/lug-logo.png" ]; then
lug_logo="/usr/share/pixmaps/lug-logo.png" lug_logo="/usr/share/pixmaps/lug-logo.png"
elif [ -f "lug-logo.png" ]; then elif [ -f "$helper_dir/lug-logo.png" ]; then
lug_logo="lug-logo.png" lug_logo="$helper_dir/lug-logo.png"
else else
lug_logo="info" lug_logo="info"
fi fi
# 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 # Github repo and script version info
repo="the-sane/lug-helper" repo="starcitizen-lug/lug-helper"
releases_url="https://github.com/the-sane/lug-helper/releases" releases_url="https://github.com/$repo/releases"
current_version="v1.11.1" current_version="v1.17"
############################################################################ ############################################################################
############################################################################ ############################################################################
@ -304,7 +326,7 @@ menu() {
elif [ -z "$menu_height" ]; then elif [ -z "$menu_height" ]; 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 'menu_height' was not set\nbefore calling the menu function. Aborting."
elif [ -z "$cancel_label" ]; then 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 fi
# Use Zenity if it is available # Use Zenity if it is available
@ -411,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
@ -438,7 +460,7 @@ getdirs() {
message warning "An unexpected error has occurred. The Helper is unable to proceed." message warning "An unexpected error has occurred. The Helper is unable to proceed."
return 1 return 1
elif [ "$(basename "$game_path")" != "$sc_base_dir" ]; then 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 else
# All good or cancel # All good or cancel
break break
@ -619,8 +641,8 @@ mapcount_once() {
mapcount_set() { mapcount_set() {
if [ -d "/etc/sysctl.d" ]; then if [ -d "/etc/sysctl.d" ]; then
# Newer versions of sysctl # 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_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-max_map_count.conf") preflight_results+=("The vm.max_map_count configuration has been appended to:\n/etc/sysctl.d/20-starcitizen-max_map_count.conf")
else else
# Older versions of sysctl # Older versions of sysctl
preflight_actions+=('printf "\n# Added by LUG-Helper:\nvm.max_map_count = 16777216" >> /etc/sysctl.conf && sysctl -p') preflight_actions+=('printf "\n# Added by LUG-Helper:\nvm.max_map_count = 16777216" >> /etc/sysctl.conf && sysctl -p')
@ -637,7 +659,7 @@ mapcount_check() {
# Add to the results and actions arrays # Add to the results and actions arrays
if [ "$mapcount" -ge 16777216 ]; then if [ "$mapcount" -ge 16777216 ]; then
# All good # 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 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? # 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.") preflight_fail+=("vm.max_map_count is configured to at least 16777216 but the setting has not been loaded by your system.")
@ -655,7 +677,7 @@ mapcount_check() {
# Add info for manually changing the setting # Add info for manually changing the setting
if [ -d "/etc/sysctl.d" ]; then if [ -d "/etc/sysctl.d" ]; then
# Newer versions of sysctl # 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 else
# Older versions of sysctl # 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") 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")
@ -679,8 +701,8 @@ filelimit_set() {
if [ -f "/etc/systemd/system.conf" ]; then if [ -f "/etc/systemd/system.conf" ]; then
# Using systemd # Using systemd
# Append to the file # Append to the file
preflight_actions+=('printf "\n# Added by LUG-Helper:\nDefaultLimitNOFILE=524288\n" >> /etc/systemd/system.conf && systemctl daemon-reexec') 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 appended to:\n/etc/systemd/system.conf") 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 elif [ -f "/etc/security/limits.conf" ]; then
# Using limits.conf # Using limits.conf
# Insert before the last line in the file # Insert before the last line in the file
@ -702,7 +724,7 @@ filelimit_check() {
# Add to the results and actions arrays # Add to the results and actions arrays
if [ "$filelimit" -ge 524288 ]; then if [ "$filelimit" -ge 524288 ]; then
# All good # 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 else
# The file limit should be changed # 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.") 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.")
@ -712,7 +734,7 @@ filelimit_check() {
# Add info for manually changing the settings # Add info for manually changing the settings
if [ -f "/etc/systemd/system.conf" ]; then if [ -f "/etc/systemd/system.conf" ]; then
# Using systemd # 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 elif [ -f "/etc/security/limits.conf" ]; then
# Using limits.conf # 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") preflight_manual+=("To change your open file descriptors limit, add the following line to\n'/etc/security/limits.conf':\n * hard nofile 524288")
@ -725,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)"
@ -744,56 +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 ---------------------#
# Delete the shaders directory #------------------------- begin download functions ----------------------------#
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 # Restart lutris if necessary
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
@ -804,22 +899,23 @@ lutris_restart() {
lutris_needs_restart="false" lutris_needs_restart="false"
} }
#------------------------- begin download functions ----------------------------# # Perform post-download actions, display messages or instructions
# Expects the variables message_heading, post_download_msg_text,
# Display post download message or instructions if needed # post_download_msg_italics, and downloaded_item_name
# Expects the variables message_heading, post_download_msg1,
# post_download_msg2, 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_msg2="<i>$post_download_msg2</i>" post_download_msg_italics="<i>$post_download_msg_italics</i>"
fi fi
message info "$message_heading\n\n$post_download_msg1\n\n$post_download_msg2\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
@ -972,10 +1068,10 @@ download_install() {
num_files=0 num_files=0
for extracted_item in "$tmp_dir/$download_name"/*; do for extracted_item in "$tmp_dir/$download_name"/*; do
if [ -d "$extracted_item" ]; then if [ -d "$extracted_item" ]; then
num_dirs="$((num_dirs+1))" num_dirs="$(($num_dirs+1))"
extracted_dir="$(basename "$extracted_item")" extracted_dir="$(basename "$extracted_item")"
elif [ -f "$extracted_item" ]; then elif [ -f "$extracted_item" ]; then
num_files="$((num_files+1))" num_files="$(($num_files+1))"
fi fi
done done
@ -1001,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
@ -1019,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"
@ -1029,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
@ -1059,11 +1152,13 @@ download_select_install() {
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
@ -1213,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
@ -1240,11 +1332,11 @@ runner_manage() {
# Set the post download instructions # Set the post download instructions
# Format: # Format:
# A header is automatically displayed that reads: Download Complete # A header is automatically displayed that reads: Download Complete
# msg1 is displayed below the header # msg_text is displayed below the header
# msg2 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_msg1="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_msg2="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
# The argument passed to the function is used for special handling # The argument passed to the function is used for special handling
@ -1256,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
@ -1264,18 +1356,18 @@ dxvk_manage() {
download_dir="$dxvk_dir" download_dir="$dxvk_dir"
# Configure the text displayed in the menus # Configure the text displayed in the menus
download_menu_heading="DXVK Versions" download_menu_heading="Lutris DXVK Versions"
download_menu_description="The DXVK versions below may help improve game performance" download_menu_description="The DXVK versions below may help improve game performance"
download_menu_height="140" download_menu_height="140"
# Set the post download instructions # Set the post download instructions
# Format: # Format:
# A header is automatically displayed that reads: Download Complete # A header is automatically displayed that reads: Download Complete
# msg1 is displayed below the header # msg_text is displayed below the header
# msg2 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_msg1="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_msg2="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
# The argument passed to the function is used for special handling # The argument passed to the function is used for special handling
@ -1283,113 +1375,127 @@ dxvk_manage() {
download_manage "dxvk" download_manage "dxvk"
} }
#-------------------------- end dxvk functions -----------------------------# #-------------------------- end download functions -----------------------------#
# Check that the system is optimized for Star Citizen # Deploy Easy Anti-Cheat Workaround
preflight_check() { eac_workaround() {
# Initialize variables # Get/set directory paths
unset preflight_pass getdirs
unset preflight_fail if [ "$?" -eq 1 ]; then
unset preflight_action_funcs # User cancelled and wants to return to the main menu
unset preflight_actions # or there was an error
unset preflight_results return 0
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 fi
if [ "${#preflight_fail[@]}" -gt 0 ]; then
preflight_fail_string="Failed Checks:" # Set the EAC directory path and hosts modification
for (( i=0; i<"${#preflight_fail[@]}"; i++ )); do eac_dir="$wine_prefix/drive_c/users/$USER/AppData/Roaming/EasyAntiCheat"
if [ "$i" -eq 0 ]; then eac_hosts="127.0.0.1 modules-cdn.eac-prod.on.epicgames.com"
preflight_fail_string="$preflight_fail_string\n- ${preflight_fail[i]//\\n/\\n }"
else # Check if EAC workaround is already applied
preflight_fail_string="$preflight_fail_string\n\n- ${preflight_fail[i]//\\n/\\n }" if grep "$eac_hosts" /etc/hosts; then
fi message info "The Easy Anti-Cheat workaround has already been applied.\nYou're all set!"
done return 1
fi fi
for (( i=0; i<"${#preflight_manual[@]}"; i++ )); do
if [ "$i" -eq 0 ]; then # Configure message variables
preflight_manual_string="${preflight_manual[i]}" 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 else
preflight_manual_string="$preflight_manual_string\n\n${preflight_manual[i]}" sudo sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
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 fi
message info "$message_heading\n\nYour system is optimized for Star Citizen!\n\n$preflight_pass_string" # Delete the EAC directory if it exists
else if [ -d "$eac_dir" ]; then
if [ -z "$preflight_action_funcs" ]; then debug_print continue "Deleting $eac_dir..."
message warning "$preflight_pass_string$preflight_fail_string" rm -r "$eac_dir"
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
message info "Easy Anti-Cheat workaround has been deployed!"
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 fi
} }
@ -1409,13 +1515,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))"
@ -1431,7 +1538,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") 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")]}"
@ -1494,19 +1601,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" ]; 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 ]
@ -1517,7 +1611,9 @@ 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
-u, --delete-user-folder Delete Star Citizen USER folder, preserving keybinds -u, --delete-user-folder Delete Star Citizen USER folder, preserving keybinds
-s, --delete-shaders Delete Star Citizen shaders directory -s, --delete-shaders Delete Star Citizen shaders directory
-c, --delete-dxvk-cache Delete Star Citizen dxvk cache file -c, --delete-dxvk-cache Delete Star Citizen dxvk cache file
@ -1532,9 +1628,15 @@ 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")
;; ;;
--manage-dxvk | -k )
cargs+=("dxvk_manage")
;;
--delete-user-folder | -u ) --delete-user-folder | -u )
cargs+=("sanitize") cargs+=("sanitize")
;; ;;
@ -1597,6 +1699,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
@ -1606,16 +1724,18 @@ while true; do
# Configure the menu options # Configure the menu options
preflight_msg="Preflight Check (System Optimization)" preflight_msg="Preflight Check (System Optimization)"
install_msg="Install Star Citizen"
eac_msg="Deploy Easy Anti-Cheat Workaround"
runners_msg="Manage Lutris Runners" runners_msg="Manage Lutris Runners"
dxvk_msg="Manage DXVK Versions" dxvk_msg="Manage Lutris DXVK Versions"
maintenance_msg="Maintenance and Troubleshooting" maintenance_msg="Maintenance and Troubleshooting"
randomizer_msg="Get a random Penguin's Star Citizen referral code" randomizer_msg="Get a random Penguin's Star Citizen referral code"
quit_msg="Quit" quit_msg="Quit"
# Set the options to be displayed in the menu # Set the options to be displayed in the menu
menu_options=("$preflight_msg" "$runners_msg" "$dxvk_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 # Set the corresponding functions to be called for each of the options
menu_actions=("preflight_check" "runner_manage" "dxvk_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 # 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))"

91
lug-lutris-install.json Normal file
View File

@ -0,0 +1,91 @@
{
"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.5.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",
"libglesv2": "disabled"
}
}
},
"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: disabled\n"
}
]
}