mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-10-23 02:05:46 +00:00
@@ -6,7 +6,8 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# Run from your terminal or use the .desktop files installed by the Helper.
|
# Run from your terminal or use the .desktop files installed by the Helper.
|
||||||
#
|
#
|
||||||
# version: 2.2
|
# version: 2.4
|
||||||
|
# License: GPLv3.0
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# ENVIRONMENT VARIABLES
|
# ENVIRONMENT VARIABLES
|
||||||
@@ -18,6 +19,8 @@
|
|||||||
export WINEPREFIX="$HOME/Games/star-citizen"
|
export WINEPREFIX="$HOME/Games/star-citizen"
|
||||||
|
|
||||||
launch_log="$WINEPREFIX/sc-launch.log"
|
launch_log="$WINEPREFIX/sc-launch.log"
|
||||||
|
unset SDL_VIDEODRIVER
|
||||||
|
|
||||||
export WINEDLLOVERRIDES=winemenubuilder.exe=d # Prevent updates from overwriting our .desktop entries
|
export WINEDLLOVERRIDES=winemenubuilder.exe=d # Prevent updates from overwriting our .desktop entries
|
||||||
export WINEDEBUG=-all # Cut down on console debug messages
|
export WINEDEBUG=-all # Cut down on console debug messages
|
||||||
# Nvidia cache options
|
# Nvidia cache options
|
||||||
|
@@ -177,7 +177,7 @@ memory_combined_required="40"
|
|||||||
lug_wiki="https://wiki.starcitizen-lug.org"
|
lug_wiki="https://wiki.starcitizen-lug.org"
|
||||||
|
|
||||||
# NixOS section in Wiki
|
# NixOS section in Wiki
|
||||||
lug_wiki_nixos="https://wiki.starcitizen-lug.org/Tips-and-Tricks#nixos"
|
lug_wiki_nixos="https://wiki.starcitizen-lug.org/Alternative-Installations#nix-installation"
|
||||||
|
|
||||||
# RSI Installer version and url
|
# RSI Installer version and url
|
||||||
rsi_installer_base_url="https://install.robertsspaceindustries.com/rel/2"
|
rsi_installer_base_url="https://install.robertsspaceindustries.com/rel/2"
|
||||||
@@ -1166,6 +1166,11 @@ download_manage() {
|
|||||||
# Initialize success
|
# Initialize success
|
||||||
unset post_download_required
|
unset post_download_required
|
||||||
|
|
||||||
|
# Set variables for the current wine runner configured in the launch script
|
||||||
|
if [ "$download_type" = "runner" ]; then
|
||||||
|
get_current_runner
|
||||||
|
fi
|
||||||
|
|
||||||
# Loop through the download_sources array and create a menu item
|
# Loop through the download_sources array and create a menu item
|
||||||
# for each one. Even numbered elements will contain the item name
|
# for each one. Even numbered elements will contain the item name
|
||||||
for (( i=0; i<"${#download_sources[@]}"; i=i+2 )); do
|
for (( i=0; i<"${#download_sources[@]}"; i=i+2 )); do
|
||||||
@@ -1398,7 +1403,9 @@ download_select_install() {
|
|||||||
|
|
||||||
# Build the menu item
|
# Build the menu item
|
||||||
unset menu_option_text
|
unset menu_option_text
|
||||||
if [ -d "${download_dir}/${download_basename}" ]; then
|
if [ -d "${download_dir}/${download_basename}" ] && [ "$download_type" = "runner" ] && [ "$current_runner_basename" = "$download_basename" ]; then
|
||||||
|
menu_option_text="$download_basename [in-use]"
|
||||||
|
elif [ -d "${download_dir}/${download_basename}" ]; then
|
||||||
menu_option_text="$download_basename [installed]"
|
menu_option_text="$download_basename [installed]"
|
||||||
else
|
else
|
||||||
# The file is not installed
|
# The file is not installed
|
||||||
@@ -1657,7 +1664,18 @@ download_select_delete() {
|
|||||||
|
|
||||||
# Create menu options for the installed items
|
# Create menu options for the installed items
|
||||||
for (( i=0; i<"${#installed_items[@]}"; i++ )); do
|
for (( i=0; i<"${#installed_items[@]}"; i++ )); do
|
||||||
menu_options+=("${installed_item_names[i]}")
|
# Build the menu item
|
||||||
|
unset menu_option_text
|
||||||
|
# Special handling for runners currently in use
|
||||||
|
if [ "$download_type" = "runner" ] && [ "$current_runner_basename" = "${installed_item_names[i]}" ]; then
|
||||||
|
menu_option_text="${installed_item_names[i]} [in-use]"
|
||||||
|
else
|
||||||
|
# Everything else
|
||||||
|
menu_option_text="${installed_item_names[i]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
menu_options+=("$menu_option_text")
|
||||||
menu_actions+=("download_delete $i")
|
menu_actions+=("download_delete $i")
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -1721,11 +1739,6 @@ download_delete() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if message question "Are you sure you want to delete the following ${download_type}(s)?\n$list_to_delete"; then
|
if message question "Are you sure you want to delete the following ${download_type}(s)?\n$list_to_delete"; then
|
||||||
# Get the current wine runner from the launch script
|
|
||||||
get_current_runner
|
|
||||||
if [ "$?" -ne 1 ]; then
|
|
||||||
current_runner_path="$(dirname "$launcher_winepath")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
unset post_delete_required
|
unset post_delete_required
|
||||||
|
|
||||||
@@ -1735,7 +1748,7 @@ download_delete() {
|
|||||||
debug_print continue "Deleted ${installed_items[${item_to_delete[i]}]}"
|
debug_print continue "Deleted ${installed_items[${item_to_delete[i]}]}"
|
||||||
|
|
||||||
# If we just deleted the currently used runner, we need to trigger post-delete to update the launch script
|
# If we just deleted the currently used runner, we need to trigger post-delete to update the launch script
|
||||||
if [ "${installed_items[${item_to_delete[i]}]}" = "$current_runner_path" ]; then
|
if [ "$download_type" = "runner" ] && [ "${installed_items[${item_to_delete[i]}]}" = "$current_runner_path" ]; then
|
||||||
post_delete_required="true"
|
post_delete_required="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1808,7 +1821,7 @@ post_download() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# We handle installs and deletions differently
|
# We handle installs and deletions differently
|
||||||
if [ "$post_download_required" = "installed" ]; then
|
if [ "$post_download_required" = "installed" ] && [ "$download_type" = "runner" ]; then
|
||||||
# We are installing a wine version and updating the launch script to use it
|
# We are installing a wine version and updating the launch script to use it
|
||||||
|
|
||||||
# Replace the specified variable in the launch script
|
# Replace the specified variable in the launch script
|
||||||
@@ -1817,7 +1830,7 @@ post_download() {
|
|||||||
|
|
||||||
# Display a confirmation message
|
# Display a confirmation message
|
||||||
message info "Wine Runner installation complete!"
|
message info "Wine Runner installation complete!"
|
||||||
elif [ "$post_download_required" = "deleted" ]; then
|
elif [ "$post_download_required" = "deleted" ] && [ "$download_type" = "runner" ]; then
|
||||||
# We deleted a custom wine version and need to revert the launch script to use the default wine runner
|
# We deleted a custom wine version and need to revert the launch script to use the default wine runner
|
||||||
|
|
||||||
# Check if the default wine runner is installed
|
# Check if the default wine runner is installed
|
||||||
@@ -2892,16 +2905,11 @@ get_current_runner() {
|
|||||||
message warning "Unable to find the current wine runner in your launch script!\n$wine_prefix/$wine_launch_script_name"
|
message warning "Unable to find the current wine runner in your launch script!\n$wine_prefix/$wine_launch_script_name"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
# MARK: format_urls()
|
# Remove the last /bin directory from the path to get the runner directory
|
||||||
# Format some URLs for Zenity
|
current_runner_path="$(dirname "$launcher_winepath")"
|
||||||
format_urls() {
|
# Get the runner filename, not including its file extension
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
current_runner_basename="$(basename "$current_runner_path")"
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# MARK: set_latest_rsi_installer()
|
# MARK: set_latest_rsi_installer()
|
||||||
@@ -2934,6 +2942,8 @@ set_latest_default_runner() {
|
|||||||
default_runner_source=0
|
default_runner_source=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# MARK: set_latest_winetricks()
|
||||||
|
# Fetch and store variables for the latest winetricks download urls
|
||||||
set_latest_winetricks() {
|
set_latest_winetricks() {
|
||||||
# Winetricks download url
|
# Winetricks download url
|
||||||
winetricks_version="$(get_latest_release Winetricks/winetricks)"
|
winetricks_version="$(get_latest_release Winetricks/winetricks)"
|
||||||
@@ -2955,6 +2965,16 @@ get_latest_release() {
|
|||||||
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
|
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# MARK: format_urls()
|
||||||
|
# Format some URLs for Zenity
|
||||||
|
format_urls() {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
# MARK: referral_randomizer()
|
# MARK: referral_randomizer()
|
||||||
# Get a random Penguin's Star Citizen referral code
|
# Get a random Penguin's Star Citizen referral code
|
||||||
referral_randomizer() {
|
referral_randomizer() {
|
||||||
|
Reference in New Issue
Block a user