mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-01 17:50:34 +00:00
Compare commits
17 Commits
25b122e891
...
v1.12
Author | SHA1 | Date | |
---|---|---|---|
1561e1a9f6 | |||
a0110720f6 | |||
c1af0383f2 | |||
74c5bd2275 | |||
48d49dd438 | |||
f080ae2bca | |||
72677ff7d5 | |||
42f9992abf | |||
786e3f4c13 | |||
08285946c8 | |||
dafc53615d | |||
3f72676c71 | |||
3d7702dfdd | |||
7ae0bcf330 | |||
8ce1a9a8ea | |||
431df4aabd | |||
9f2c72042e |
@ -61,10 +61,10 @@ 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 basename)" ] || [ ! -x "$(command -v sort)" ]; 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 packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)\n- sort (part of gnu coreutils)\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 packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)\n- sort (part of gnu coreutils)\n" --icon=dialog-warning
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -145,9 +145,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 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.12"
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -304,7 +304,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
|
||||||
@ -637,7 +637,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.")
|
||||||
@ -702,7 +702,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.")
|
||||||
@ -807,17 +807,17 @@ lutris_restart() {
|
|||||||
#------------------------- begin download functions ----------------------------#
|
#------------------------- begin download functions ----------------------------#
|
||||||
|
|
||||||
# Display post download message or instructions if needed
|
# Display post download message or instructions if needed
|
||||||
# Expects the variables message_heading, post_download_msg1,
|
# Expects the variables message_heading, post_download_msg_text,
|
||||||
# post_download_msg2, and downloaded_item_name
|
# post_download_msg_italics, and downloaded_item_name
|
||||||
post_download() {
|
post_download() {
|
||||||
if [ "$trigger_post_download" = "true" ]; then
|
if [ "$trigger_post_download" = "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\n$post_download_msg_italics\n$downloaded_item_name"
|
||||||
fi
|
fi
|
||||||
trigger_post_download="false"
|
trigger_post_download="false"
|
||||||
}
|
}
|
||||||
@ -972,10 +972,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
|
||||||
|
|
||||||
@ -985,21 +985,21 @@ download_install() {
|
|||||||
message warning "The downloaded archive is empty. There is nothing to do."
|
message warning "The downloaded archive is empty. There is nothing to do."
|
||||||
elif [ "$num_dirs" -eq 1 ] && [ "$num_files" -eq 0 ]; then
|
elif [ "$num_dirs" -eq 1 ] && [ "$num_files" -eq 0 ]; then
|
||||||
# If the archive contains only one directory, install that directory
|
# If the archive contains only one directory, install that directory
|
||||||
debug_print continue "Installing $download_type into $download_dir/$extracted_dir..."
|
# We rename it to the name of the archive in case it is different
|
||||||
|
# so we can easily detect installed items in download_select_install()
|
||||||
|
debug_print continue "Installing $download_type into $download_dir/$download_name..."
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
# Use Zenity progress bar
|
# Use Zenity progress bar
|
||||||
mkdir -p "$download_dir" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir" | \
|
mkdir -p "$download_dir" && cp -r "$tmp_dir/$download_name/$extracted_dir" "$download_dir/$download_name" | \
|
||||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing ${download_type}...\n" 2>/dev/null
|
||||||
else
|
else
|
||||||
mkdir -p "$download_dir" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir"
|
mkdir -p "$download_dir" && cp -r "$tmp_dir/$download_name/$extracted_dir" "$download_dir/$download_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We need to restart Lutris for the download to be detected
|
# We need to restart Lutris for the download to be detected
|
||||||
lutris_needs_restart="true"
|
lutris_needs_restart="true"
|
||||||
|
|
||||||
# Store the final name of the downloaded directory
|
# Store the final name of the downloaded directory
|
||||||
downloaded_item_name="$extracted_dir"
|
downloaded_item_name="$download_name"
|
||||||
|
|
||||||
# Trigger the post_download() function
|
# Trigger the post_download() function
|
||||||
trigger_post_download="true"
|
trigger_post_download="true"
|
||||||
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
|
||||||
@ -1016,10 +1016,8 @@ download_install() {
|
|||||||
|
|
||||||
# We need to restart Lutris for the download to be detected
|
# We need to restart Lutris for the download to be detected
|
||||||
lutris_needs_restart="true"
|
lutris_needs_restart="true"
|
||||||
|
|
||||||
# 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"
|
trigger_post_download="true"
|
||||||
else
|
else
|
||||||
@ -1242,11 +1240,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 runner in Lutris from the dropdown menu"
|
||||||
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
|
||||||
@ -1273,11 +1271,11 @@ dxvk_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="Type the DXVK folder name in your Lutris settings"
|
post_download_msg_text="Type the DXVK folder name in your Lutris settings"
|
||||||
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
|
||||||
@ -1433,7 +1431,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")
|
||||||
# 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")]}"
|
||||||
@ -1499,7 +1497,8 @@ live_or_ptu="$live_dir"
|
|||||||
# Check if a newer verison of the script is available
|
# Check if a newer verison of the script is available
|
||||||
latest_version="$(get_latest_release "$repo")"
|
latest_version="$(get_latest_release "$repo")"
|
||||||
|
|
||||||
if [ "$latest_version" != "$current_version" ]; then
|
if [ "$latest_version" != "$current_version" ] &&
|
||||||
|
[ "$current_version" = "$(printf "$current_version\n$latest_version" | sort -V | head -n1)" ]; then
|
||||||
if [ "$use_zenity" -eq 1 ]; then
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
releases_url_formatted="<a href='$releases_url'>$releases_url</a>"
|
releases_url_formatted="<a href='$releases_url'>$releases_url</a>"
|
||||||
else
|
else
|
||||||
@ -1520,6 +1519,7 @@ if [ "$#" -gt 0 ]; then
|
|||||||
Usage: lug-helper <options>
|
Usage: lug-helper <options>
|
||||||
-p, --preflight-check Run system optimization checks
|
-p, --preflight-check Run system optimization checks
|
||||||
-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
|
||||||
@ -1537,6 +1537,9 @@ Usage: lug-helper <options>
|
|||||||
--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")
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user