mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-01-15 23:40:35 +00:00
Compare commits
No commits in common. "0d2845b61473131f838e811c3cdb4eb783b5d432" and "1e70ad8d644c1ad14e6b786d4ef85239ff12fd8b" have entirely different histories.
0d2845b614
...
1e70ad8d64
@ -82,5 +82,4 @@ _Optional Dependencies: **zenity** (for GUI)_
|
||||
- https://github.com/victort
|
||||
- https://github.com/Wrzlprnft
|
||||
- https://github.com/ananace
|
||||
- https://github.com/LovingMelody
|
||||
- Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater
|
||||
|
@ -46,7 +46,6 @@
|
||||
# Contributor: https://github.com/gort818
|
||||
# Contributor: https://github.com/victort
|
||||
# Contributor: https://github.com/Wrzlprnft
|
||||
# Contributor: https://github.com/LovingMelody
|
||||
# Runner Downloader inspired by:
|
||||
# https://github.com/richardtatum/sc-runner-updater
|
||||
#
|
||||
@ -87,12 +86,6 @@ if [ ! -x "$(command -v xargs)" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Checks for NixOS for NixOS specific options
|
||||
if (grep '^NAME=NixOS' /etc/os-release -q 2> /dev/null ); then
|
||||
is_nixos=1
|
||||
else
|
||||
is_nixos=0
|
||||
fi
|
||||
|
||||
######## Config ############################################################
|
||||
|
||||
@ -229,10 +222,6 @@ repo="starcitizen-lug/lug-helper"
|
||||
releases_url="https://github.com/$repo/releases"
|
||||
current_version="v2.8"
|
||||
|
||||
# FIXME: Link
|
||||
# NixOS section in Wiki
|
||||
lug_wiki_nixos="https://github.com/starcitizen-lug/knowledge-base/wiki/Tips-and-Tricks"
|
||||
|
||||
############################################################################
|
||||
############################################################################
|
||||
############################################################################
|
||||
@ -318,7 +307,7 @@ message() {
|
||||
if [ "$#" -lt 2 ]; then
|
||||
debug_print exit "Script error: The message function expects two arguments. Aborting."
|
||||
fi
|
||||
|
||||
|
||||
# Use zenity messages if available
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
case "$1" in
|
||||
@ -369,12 +358,14 @@ message() {
|
||||
"info")
|
||||
# info message
|
||||
# call format: message info "text to display"
|
||||
clear
|
||||
printf "\n$2\n\n"
|
||||
read -n 1 -s -p "Press any key..."
|
||||
;;
|
||||
"warning")
|
||||
# warning message
|
||||
# call format: message warning "text to display"
|
||||
clear
|
||||
printf "\n$2\n\n"
|
||||
read -n 1 -s -p "Press any key..."
|
||||
;;
|
||||
@ -387,6 +378,7 @@ message() {
|
||||
"question")
|
||||
# question
|
||||
# call format: if message question "question to ask?"; then...
|
||||
clear
|
||||
printf "$2\n"
|
||||
while read -p "[y/n]: " yn; do
|
||||
case "$yn" in
|
||||
@ -424,7 +416,7 @@ message() {
|
||||
# - The integer "menu_height" specifies the height of the zenity menu.
|
||||
# - The string "menu_type" should contain either "radiolist" or "checklist".
|
||||
# - The string "cancel_label" should contain the text of the cancel button.
|
||||
#
|
||||
#
|
||||
# The final element in each array is expected to be a quit option.
|
||||
#
|
||||
# IMPORTANT: The indices of the elements in "menu_actions"
|
||||
@ -498,7 +490,7 @@ menu() {
|
||||
ifsBAK="$IFS"
|
||||
IFS='|' read -a choices <<< "$choice"
|
||||
IFS="$ifsBAK"
|
||||
|
||||
|
||||
# Fetch the function to be called
|
||||
function_call="$(echo "${menu_actions[0]}" | awk '{print $1}')"
|
||||
|
||||
@ -536,8 +528,8 @@ menu() {
|
||||
matched="false"
|
||||
for (( i=0; i<"${#menu_options[@]}"; i++ )); do
|
||||
if [ "$choice" = "${menu_options[i]}" ]; then
|
||||
clear
|
||||
# Execute the corresponding action
|
||||
printf "\n\n"
|
||||
${menu_actions[i]}
|
||||
matched="true"
|
||||
break
|
||||
@ -611,7 +603,7 @@ getdirs() {
|
||||
|
||||
# Get the game path
|
||||
if [ -z "$game_path" ]; then
|
||||
if [ -d "$wine_prefix/$install_path" ] &&
|
||||
if [ -d "$wine_prefix/$install_path" ] &&
|
||||
message question "Is this your Star Citizen game directory?\n\n$wine_prefix/$install_path"; then
|
||||
game_path="$wine_prefix/$install_path"
|
||||
else
|
||||
@ -626,7 +618,7 @@ getdirs() {
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [ -z "$game_path" ]; then
|
||||
# User clicked cancel
|
||||
message warning "Operation cancelled.\nNo changes have been made to your game."
|
||||
@ -652,7 +644,7 @@ getdirs() {
|
||||
|
||||
# Get the game path
|
||||
if [ -z "$game_path" ]; then
|
||||
if [ -d "$wine_prefix/$install_path" ] &&
|
||||
if [ -d "$wine_prefix/$install_path" ] &&
|
||||
message question "Is this your Star Citizen game directory?\n\n$wine_prefix/$install_path"; then
|
||||
game_path="$wine_prefix/$install_path"
|
||||
else
|
||||
@ -670,7 +662,7 @@ getdirs() {
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Save the paths for later use
|
||||
echo "$wine_prefix" > "$conf_dir/$conf_subdir/$wine_conf"
|
||||
echo "$game_path" > "$conf_dir/$conf_subdir/$game_conf"
|
||||
@ -723,7 +715,7 @@ mapcount_set() {
|
||||
preflight_actions+=('printf "\n# Added by LUG-Helper:\nvm.max_map_count = 16777216" >> /etc/sysctl.conf && sysctl -p')
|
||||
preflight_results+=("The vm.max_map_count configuration has been added to:\n/etc/sysctl.conf")
|
||||
fi
|
||||
|
||||
|
||||
# Verify that the setting took effect
|
||||
preflight_followup+=("mapcount_confirm")
|
||||
}
|
||||
@ -956,7 +948,7 @@ preflight_check() {
|
||||
unset preflight_results
|
||||
unset preflight_manual
|
||||
unset preflight_followup
|
||||
|
||||
|
||||
# Call the optimization functions to perform the checks
|
||||
lutris_check
|
||||
wine_check
|
||||
@ -1005,7 +997,7 @@ preflight_check() {
|
||||
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 [ "${#preflight_action_funcs[@]}" -eq 0 ]; then
|
||||
@ -1224,8 +1216,8 @@ post_download() {
|
||||
# Accepts array index numbers as an argument
|
||||
#
|
||||
# The following variables are expected to be set before calling this function:
|
||||
# - download_type (string)
|
||||
# - installed_items (array)
|
||||
# - download_type (string)
|
||||
# - installed_items (array)
|
||||
# - installed_item_names (array)
|
||||
download_delete() {
|
||||
# This function expects at least one index number for the array installed_items to be passed in as an argument
|
||||
@ -1435,7 +1427,7 @@ download_install() {
|
||||
message error "Something went wrong and the requested $download_type file could not be downloaded!"
|
||||
debug_print continue "Download failed! File not found: $tmp_dir/$download_file"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Extract the archive to the tmp directory
|
||||
debug_print continue "Extracting $download_type into $tmp_dir/$download_name..."
|
||||
@ -1551,7 +1543,7 @@ download_select_install() {
|
||||
elif [ "${#download_dirs[@]}" -eq 0 ]; then
|
||||
debug_print exit "Script error: The array 'download_dirs' was not set\nbefore calling the download_select_install function. Aborting."
|
||||
fi
|
||||
|
||||
|
||||
# Store info from the selected contributor
|
||||
contributor_name="${download_sources[$1]}"
|
||||
contributor_url="${download_sources[$1+1]}"
|
||||
@ -1756,7 +1748,7 @@ download_select_install() {
|
||||
# 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
|
||||
@ -1766,10 +1758,10 @@ download_select_install() {
|
||||
if [ "$menu_height" -gt "400" ]; then
|
||||
menu_height="400"
|
||||
fi
|
||||
|
||||
|
||||
# Set the label for the cancel button
|
||||
cancel_label="Go Back"
|
||||
|
||||
|
||||
# Call the menu function. It will use the options as configured above
|
||||
menu
|
||||
}
|
||||
@ -1842,7 +1834,7 @@ download_manage() {
|
||||
# Set the corresponding functions to be called for each of the options
|
||||
menu_actions+=("download_select_install $i")
|
||||
done
|
||||
|
||||
|
||||
# Complete the menu by adding options to uninstall an item
|
||||
# or go back to the previous menu
|
||||
menu_options+=("$delete" "$back")
|
||||
@ -1850,10 +1842,10 @@ download_manage() {
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
|
||||
|
||||
# Set the label for the cancel button
|
||||
cancel_label="Go Back"
|
||||
|
||||
|
||||
# Call the menu function. It will use the options as configured above
|
||||
menu
|
||||
|
||||
@ -2029,7 +2021,7 @@ rm_userdir() {
|
||||
debug_print continue "Backing up keybinds to $backup_path/keybinds..."
|
||||
mkdir -p "$backup_path/keybinds" && cp -r "$keybinds_dir/." "$backup_path/keybinds/"
|
||||
fi
|
||||
|
||||
|
||||
# Wipe the user directory
|
||||
debug_print continue "Wiping $user_dir..."
|
||||
rm -r "$user_dir"
|
||||
@ -2173,7 +2165,7 @@ maintenance_menu() {
|
||||
while [ "$looping_menu" = "true" ]; do
|
||||
# Configure the menu
|
||||
menu_text_zenity="<b><big>Game Maintenance and Troubleshooting</big>\n\nLUG Wiki: $lug_wiki</b>\n\nYou may choose from the following options:"
|
||||
menu_text_terminal="Game Maintenance and Troubleshooting\n\nLUG Wiki: $lug_wiki\n\nYou may choose from the following options:"
|
||||
menu_text_terminal="Game Maintenance and Troubleshooting\n\nYou may choose from the following options:"
|
||||
menu_text_height="140"
|
||||
menu_type="radiolist"
|
||||
|
||||
@ -2185,7 +2177,7 @@ maintenance_menu() {
|
||||
dirs_msg="Display Helper and Star Citizen directories"
|
||||
reset_msg="Reset Helper configs"
|
||||
quit_msg="Return to the main menu"
|
||||
|
||||
|
||||
# Set the options to be displayed in the menu
|
||||
menu_options=("$version_msg" "$userdir_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$reset_msg" "$quit_msg")
|
||||
# Set the corresponding functions to be called for each of the options
|
||||
@ -2193,10 +2185,10 @@ maintenance_menu() {
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
|
||||
|
||||
# Set the label for the cancel button
|
||||
cancel_label="Go Back"
|
||||
|
||||
|
||||
# Call the menu function. It will use the options as configured above
|
||||
menu
|
||||
done
|
||||
@ -2242,7 +2234,7 @@ install_game() {
|
||||
# We shouldn't get here
|
||||
debug_print exit "Script error: Unable to detect Lutris version in install_game function. Aborting."
|
||||
fi
|
||||
|
||||
|
||||
# Run the appropriate installer
|
||||
if [ "$install_version" = "native" ]; then
|
||||
lutris --install "$install_script" &
|
||||
@ -2349,7 +2341,7 @@ get_latest_release() {
|
||||
if [ "$#" -lt 1 ]; then
|
||||
debug_print exit "Script error: The get_latest_release function expects one argument. Aborting."
|
||||
fi
|
||||
|
||||
|
||||
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
|
||||
grep '"tag_name":' | # Get tag line
|
||||
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
|
||||
@ -2382,7 +2374,6 @@ live_or_ptu="$live_dir"
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
releases_url="<a href='$releases_url'>$releases_url</a>"
|
||||
lug_wiki="<a href='$lug_wiki'>$lug_wiki</a>"
|
||||
lug_wiki_nixos="<a href='$lug_wiki_nixos'>$lug_wiki_nixos</a>"
|
||||
fi
|
||||
|
||||
# Check if a newer verison of the script is available
|
||||
@ -2506,11 +2497,6 @@ Usage: lug-helper <options>
|
||||
fi
|
||||
fi
|
||||
|
||||
# Detect if NixOS is being used and direct user to wiki
|
||||
if [ "$is_nixos" -eq 1 ]; then
|
||||
message info "It looks like you're using NixOS\nPlease see our wiki for NixOS-specific configuration requirements:\n\n$lug_wiki_nixos"
|
||||
fi
|
||||
|
||||
# Loop the main menu until the user selects quit
|
||||
while true; do
|
||||
# Configure the menu
|
||||
@ -2528,7 +2514,7 @@ while true; do
|
||||
maintenance_msg="Maintenance and Troubleshooting"
|
||||
randomizer_msg="Get a random Penguin's Star Citizen referral code"
|
||||
quit_msg="Quit"
|
||||
|
||||
|
||||
# Set the options to be displayed in the menu
|
||||
menu_options=("$preflight_msg" "$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
|
||||
@ -2536,10 +2522,10 @@ while true; do
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
|
||||
|
||||
# Set the label for the cancel button
|
||||
cancel_label="Quit"
|
||||
|
||||
|
||||
# Call the menu function. It will use the options as configured above
|
||||
menu
|
||||
done
|
||||
|
@ -17,7 +17,7 @@
|
||||
"notes": "Performance may be choppy for 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!",
|
||||
"credits": "",
|
||||
"created_at": "2023-03-24T06:40:19.908354Z",
|
||||
"updated_at": "2023-07-22T11:30:46.512132Z",
|
||||
"updated_at": "2023-07-03T01:53:34.512132Z",
|
||||
"draft": false,
|
||||
"published": true,
|
||||
"published_by": null,
|
||||
@ -32,7 +32,7 @@
|
||||
"script": {
|
||||
"files": [
|
||||
{
|
||||
"client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.6.7.exe"
|
||||
"client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.6.6.exe"
|
||||
}
|
||||
],
|
||||
"game": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user