Compare commits

...

10 Commits

Author SHA1 Message Date
the-sane
0d2845b614 Move wiki formatting 2023-07-28 22:59:44 -04:00
the Sane
45029a7797
Merge pull request #61 from LovingMelody/master
Fix: Fix screen clear when flags are used
2023-07-28 22:02:27 -04:00
Melody Renata
32d57e9c2b
Fix: Fix screen clear when flags are used 2023-07-28 22:00:46 -04:00
the Sane
cc9b516646
Merge pull request #59 from LovingMelody/master
Add: Add NixOS Check
2023-07-28 21:30:59 -04:00
Melody Renata
3b5b1a4356
Add: Add NixOS Check 2023-07-28 21:29:04 -04:00
the Sane
cf9826bb0d
Merge pull request #58 from LovingMelody/master
Chore: Remove trailing whitespace
2023-07-28 20:44:31 -04:00
Melody Renata
3875a9a674
Chore: Remove trailing whitespace 2023-07-28 20:42:02 -04:00
the-sane
74b5c09b89 Add wiki link to terminal menu 2023-07-28 20:40:54 -04:00
Termuellinator
a807b31216
Merge pull request #57 from LovingMelody/master
Update lutris-sc-install.json: Bump RSI Launcher to 1.6.7
2023-07-22 13:35:31 +02:00
Melody Renata
ab6eeab932
Update lutris-sc-install.json: Bump RSI Launcher to 1.6.7 2023-07-22 07:32:36 -04:00
3 changed files with 51 additions and 36 deletions

View File

@ -82,4 +82,5 @@ _Optional Dependencies: **zenity** (for GUI)_
- https://github.com/victort - https://github.com/victort
- https://github.com/Wrzlprnft - https://github.com/Wrzlprnft
- https://github.com/ananace - https://github.com/ananace
- https://github.com/LovingMelody
- Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater - Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater

View File

@ -46,6 +46,7 @@
# Contributor: https://github.com/gort818 # Contributor: https://github.com/gort818
# Contributor: https://github.com/victort # Contributor: https://github.com/victort
# Contributor: https://github.com/Wrzlprnft # Contributor: https://github.com/Wrzlprnft
# Contributor: https://github.com/LovingMelody
# Runner Downloader inspired by: # Runner Downloader inspired by:
# https://github.com/richardtatum/sc-runner-updater # https://github.com/richardtatum/sc-runner-updater
# #
@ -86,6 +87,12 @@ if [ ! -x "$(command -v xargs)" ]; then
exit 1 exit 1
fi 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 ############################################################ ######## Config ############################################################
@ -222,6 +229,10 @@ repo="starcitizen-lug/lug-helper"
releases_url="https://github.com/$repo/releases" releases_url="https://github.com/$repo/releases"
current_version="v2.8" current_version="v2.8"
# FIXME: Link
# NixOS section in Wiki
lug_wiki_nixos="https://github.com/starcitizen-lug/knowledge-base/wiki/Tips-and-Tricks"
############################################################################ ############################################################################
############################################################################ ############################################################################
############################################################################ ############################################################################
@ -307,7 +318,7 @@ message() {
if [ "$#" -lt 2 ]; then if [ "$#" -lt 2 ]; then
debug_print exit "Script error: The message function expects two arguments. Aborting." debug_print exit "Script error: The message function expects two arguments. Aborting."
fi fi
# Use zenity messages if available # Use zenity messages if available
if [ "$use_zenity" -eq 1 ]; then if [ "$use_zenity" -eq 1 ]; then
case "$1" in case "$1" in
@ -358,14 +369,12 @@ message() {
"info") "info")
# info message # info message
# call format: message info "text to display" # call format: message info "text to display"
clear
printf "\n$2\n\n" printf "\n$2\n\n"
read -n 1 -s -p "Press any key..." read -n 1 -s -p "Press any key..."
;; ;;
"warning") "warning")
# warning message # warning message
# call format: message warning "text to display" # call format: message warning "text to display"
clear
printf "\n$2\n\n" printf "\n$2\n\n"
read -n 1 -s -p "Press any key..." read -n 1 -s -p "Press any key..."
;; ;;
@ -378,7 +387,6 @@ message() {
"question") "question")
# question # question
# call format: if message question "question to ask?"; then... # call format: if message question "question to ask?"; then...
clear
printf "$2\n" printf "$2\n"
while read -p "[y/n]: " yn; do while read -p "[y/n]: " yn; do
case "$yn" in case "$yn" in
@ -416,7 +424,7 @@ message() {
# - The integer "menu_height" specifies the height of the zenity menu. # - The integer "menu_height" specifies the height of the zenity menu.
# - The string "menu_type" should contain either "radiolist" or "checklist". # - The string "menu_type" should contain either "radiolist" or "checklist".
# - The string "cancel_label" should contain the text of the cancel button. # - 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. # The final element in each array is expected to be a quit option.
# #
# IMPORTANT: The indices of the elements in "menu_actions" # IMPORTANT: The indices of the elements in "menu_actions"
@ -490,7 +498,7 @@ menu() {
ifsBAK="$IFS" ifsBAK="$IFS"
IFS='|' read -a choices <<< "$choice" IFS='|' read -a choices <<< "$choice"
IFS="$ifsBAK" IFS="$ifsBAK"
# Fetch the function to be called # Fetch the function to be called
function_call="$(echo "${menu_actions[0]}" | awk '{print $1}')" function_call="$(echo "${menu_actions[0]}" | awk '{print $1}')"
@ -528,8 +536,8 @@ menu() {
matched="false" matched="false"
for (( i=0; i<"${#menu_options[@]}"; i++ )); do for (( i=0; i<"${#menu_options[@]}"; i++ )); do
if [ "$choice" = "${menu_options[i]}" ]; then if [ "$choice" = "${menu_options[i]}" ]; then
clear
# Execute the corresponding action # Execute the corresponding action
printf "\n\n"
${menu_actions[i]} ${menu_actions[i]}
matched="true" matched="true"
break break
@ -603,7 +611,7 @@ getdirs() {
# Get the game path # Get the game path
if [ -z "$game_path" ]; then 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 message question "Is this your Star Citizen game directory?\n\n$wine_prefix/$install_path"; then
game_path="$wine_prefix/$install_path" game_path="$wine_prefix/$install_path"
else else
@ -618,7 +626,7 @@ getdirs() {
break break
fi fi
done done
if [ -z "$game_path" ]; then if [ -z "$game_path" ]; then
# User clicked cancel # User clicked cancel
message warning "Operation cancelled.\nNo changes have been made to your game." message warning "Operation cancelled.\nNo changes have been made to your game."
@ -644,7 +652,7 @@ getdirs() {
# Get the game path # Get the game path
if [ -z "$game_path" ]; then 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 message question "Is this your Star Citizen game directory?\n\n$wine_prefix/$install_path"; then
game_path="$wine_prefix/$install_path" game_path="$wine_prefix/$install_path"
else else
@ -662,7 +670,7 @@ getdirs() {
fi fi
fi fi
fi fi
# Save the paths for later use # Save the paths for later use
echo "$wine_prefix" > "$conf_dir/$conf_subdir/$wine_conf" echo "$wine_prefix" > "$conf_dir/$conf_subdir/$wine_conf"
echo "$game_path" > "$conf_dir/$conf_subdir/$game_conf" echo "$game_path" > "$conf_dir/$conf_subdir/$game_conf"
@ -715,7 +723,7 @@ mapcount_set() {
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')
preflight_results+=("The vm.max_map_count configuration has been added to:\n/etc/sysctl.conf") preflight_results+=("The vm.max_map_count configuration has been added to:\n/etc/sysctl.conf")
fi fi
# Verify that the setting took effect # Verify that the setting took effect
preflight_followup+=("mapcount_confirm") preflight_followup+=("mapcount_confirm")
} }
@ -948,7 +956,7 @@ preflight_check() {
unset preflight_results unset preflight_results
unset preflight_manual unset preflight_manual
unset preflight_followup unset preflight_followup
# Call the optimization functions to perform the checks # Call the optimization functions to perform the checks
lutris_check lutris_check
wine_check wine_check
@ -997,7 +1005,7 @@ preflight_check() {
if [ "$use_zenity" -eq 1 ]; then if [ "$use_zenity" -eq 1 ]; then
message_heading="<b>$message_heading</b>" 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" message info "$message_heading\n\nYour system is optimized for Star Citizen!\n\n$preflight_pass_string"
else else
if [ "${#preflight_action_funcs[@]}" -eq 0 ]; then if [ "${#preflight_action_funcs[@]}" -eq 0 ]; then
@ -1216,8 +1224,8 @@ post_download() {
# Accepts array index numbers as an argument # Accepts array index numbers as an argument
# #
# The following variables are expected to be set before calling this function: # The following variables are expected to be set before calling this function:
# - download_type (string) # - download_type (string)
# - installed_items (array) # - installed_items (array)
# - installed_item_names (array) # - installed_item_names (array)
download_delete() { download_delete() {
# This function expects at least one index number for the array installed_items to be passed in as an argument # This function expects at least one index number for the array installed_items to be passed in as an argument
@ -1427,7 +1435,7 @@ download_install() {
message error "Something went wrong and the requested $download_type file could not be downloaded!" 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" debug_print continue "Download failed! File not found: $tmp_dir/$download_file"
return 1 return 1
fi fi
# Extract the archive to the tmp directory # Extract the archive to the tmp directory
debug_print continue "Extracting $download_type into $tmp_dir/$download_name..." debug_print continue "Extracting $download_type into $tmp_dir/$download_name..."
@ -1543,7 +1551,7 @@ download_select_install() {
elif [ "${#download_dirs[@]}" -eq 0 ]; then 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." debug_print exit "Script error: The array 'download_dirs' was not set\nbefore calling the download_select_install function. Aborting."
fi fi
# Store info from the selected contributor # Store info from the selected contributor
contributor_name="${download_sources[$1]}" contributor_name="${download_sources[$1]}"
contributor_url="${download_sources[$1+1]}" contributor_url="${download_sources[$1+1]}"
@ -1748,7 +1756,7 @@ download_select_install() {
# Increment the added items counter # Increment the added items counter
num_download_items="$(($num_download_items+1))" num_download_items="$(($num_download_items+1))"
done done
# Complete the menu by adding the option to go back to the previous menu # Complete the menu by adding the option to go back to the previous menu
menu_options+=("$goback") menu_options+=("$goback")
menu_actions+=(":") # no-op menu_actions+=(":") # no-op
@ -1758,10 +1766,10 @@ download_select_install() {
if [ "$menu_height" -gt "400" ]; then if [ "$menu_height" -gt "400" ]; then
menu_height="400" menu_height="400"
fi fi
# Set the label for the cancel button # Set the label for the cancel button
cancel_label="Go Back" cancel_label="Go Back"
# 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
} }
@ -1834,7 +1842,7 @@ download_manage() {
# 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+=("download_select_install $i") menu_actions+=("download_select_install $i")
done done
# Complete the menu by adding options to uninstall an item # Complete the menu by adding options to uninstall an item
# or go back to the previous menu # or go back to the previous menu
menu_options+=("$delete" "$back") menu_options+=("$delete" "$back")
@ -1842,10 +1850,10 @@ download_manage() {
# 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))"
# Set the label for the cancel button # Set the label for the cancel button
cancel_label="Go Back" cancel_label="Go Back"
# 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
@ -2021,7 +2029,7 @@ rm_userdir() {
debug_print continue "Backing up keybinds to $backup_path/keybinds..." debug_print continue "Backing up keybinds to $backup_path/keybinds..."
mkdir -p "$backup_path/keybinds" && cp -r "$keybinds_dir/." "$backup_path/keybinds/" mkdir -p "$backup_path/keybinds" && cp -r "$keybinds_dir/." "$backup_path/keybinds/"
fi fi
# Wipe the user directory # Wipe the user directory
debug_print continue "Wiping $user_dir..." debug_print continue "Wiping $user_dir..."
rm -r "$user_dir" rm -r "$user_dir"
@ -2165,7 +2173,7 @@ maintenance_menu() {
while [ "$looping_menu" = "true" ]; do while [ "$looping_menu" = "true" ]; do
# Configure the menu # 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_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\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_height="140" menu_text_height="140"
menu_type="radiolist" menu_type="radiolist"
@ -2177,7 +2185,7 @@ maintenance_menu() {
dirs_msg="Display Helper and Star Citizen directories" dirs_msg="Display Helper and Star Citizen directories"
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" "$userdir_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$reset_msg" "$quit_msg") 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 # Set the corresponding functions to be called for each of the options
@ -2185,10 +2193,10 @@ maintenance_menu() {
# 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))"
# Set the label for the cancel button # Set the label for the cancel button
cancel_label="Go Back" cancel_label="Go Back"
# 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
done done
@ -2234,7 +2242,7 @@ install_game() {
# We shouldn't get here # We shouldn't get here
debug_print exit "Script error: Unable to detect Lutris version in install_game function. Aborting." debug_print exit "Script error: Unable to detect Lutris version in install_game function. Aborting."
fi fi
# Run the appropriate installer # Run the appropriate installer
if [ "$install_version" = "native" ]; then if [ "$install_version" = "native" ]; then
lutris --install "$install_script" & lutris --install "$install_script" &
@ -2341,7 +2349,7 @@ get_latest_release() {
if [ "$#" -lt 1 ]; then if [ "$#" -lt 1 ]; then
debug_print exit "Script error: The get_latest_release function expects one argument. Aborting." debug_print exit "Script error: The get_latest_release function expects one argument. Aborting."
fi fi
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
@ -2374,6 +2382,7 @@ live_or_ptu="$live_dir"
if [ "$use_zenity" -eq 1 ]; then if [ "$use_zenity" -eq 1 ]; then
releases_url="<a href='$releases_url'>$releases_url</a>" releases_url="<a href='$releases_url'>$releases_url</a>"
lug_wiki="<a href='$lug_wiki'>$lug_wiki</a>" lug_wiki="<a href='$lug_wiki'>$lug_wiki</a>"
lug_wiki_nixos="<a href='$lug_wiki_nixos'>$lug_wiki_nixos</a>"
fi fi
# Check if a newer verison of the script is available # Check if a newer verison of the script is available
@ -2497,6 +2506,11 @@ Usage: lug-helper <options>
fi fi
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 # Loop the main menu until the user selects quit
while true; do while true; do
# Configure the menu # Configure the menu
@ -2514,7 +2528,7 @@ while true; do
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" "$install_msg" "$eac_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
@ -2522,10 +2536,10 @@ while true; do
# 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))"
# Set the label for the cancel button # Set the label for the cancel button
cancel_label="Quit" cancel_label="Quit"
# 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
done done

View File

@ -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!", "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": "", "credits": "",
"created_at": "2023-03-24T06:40:19.908354Z", "created_at": "2023-03-24T06:40:19.908354Z",
"updated_at": "2023-07-03T01:53:34.512132Z", "updated_at": "2023-07-22T11:30:46.512132Z",
"draft": false, "draft": false,
"published": true, "published": true,
"published_by": null, "published_by": null,
@ -32,7 +32,7 @@
"script": { "script": {
"files": [ "files": [
{ {
"client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.6.6.exe" "client": "https://install.robertsspaceindustries.com/star-citizen/RSI-Setup-1.6.7.exe"
} }
], ],
"game": { "game": {