mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-01-16 17:20:36 +00:00
Compare commits
No commits in common. "bed6e76ba335040fc1f4fc16a5737fb115bc440b" and "3d6eee99d13fb8d2ad919407ace3e00273512f78" have entirely different histories.
bed6e76ba3
...
3d6eee99d1
@ -71,11 +71,11 @@ fi
|
|||||||
# notify-send "lug-helper" "The package 'zstd' was not found on this system. It is required for extracting some runner packages.\n" --icon=dialog-warning
|
# notify-send "lug-helper" "The package 'zstd' was not found on this system. It is required for extracting some runner packages.\n" --icon=dialog-warning
|
||||||
# exit 1
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v sort)" ] || [ ! -x "$(command -v basename)" ] || [ ! -x "$(command -v realpath)" ] || [ ! -x "$(command -v dirname)" ] || [ ! -x "$(command -v numfmt)" ]; then
|
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v sort)" ] || [ ! -x "$(command -v basename)" ] || [ ! -x "$(command -v realpath)" ] || [ ! -x "$(command -v dirname)" ]; then
|
||||||
# coreutils
|
# coreutils
|
||||||
# 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 coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\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 coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\n- numfmt\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
|
||||||
if [ ! -x "$(command -v xargs)" ]; then
|
if [ ! -x "$(command -v xargs)" ]; then
|
||||||
@ -122,6 +122,12 @@ max_download_items=20
|
|||||||
# used to dynamically determine the height of menus
|
# used to dynamically determine the height of menus
|
||||||
menu_option_height="26"
|
menu_option_height="26"
|
||||||
|
|
||||||
|
# winetricks minimum version
|
||||||
|
winetricks_required="20220411"
|
||||||
|
|
||||||
|
# lutris minimum version
|
||||||
|
lutris_required="0.5.11"
|
||||||
|
|
||||||
######## Game Directories ##################################################
|
######## Game Directories ##################################################
|
||||||
|
|
||||||
# The game's base directory name
|
# The game's base directory name
|
||||||
@ -141,26 +147,6 @@ shaders_subdir="shaders"
|
|||||||
|
|
||||||
# Remaining directory paths are set at the end of the getdirs() function
|
# Remaining directory paths are set at the end of the getdirs() function
|
||||||
|
|
||||||
######## Bundled Files #####################################################
|
|
||||||
|
|
||||||
# Use logo installed by a packaged version of this script if available
|
|
||||||
# Otherwise, default to the logo in the same directory
|
|
||||||
if [ -f "/usr/share/pixmaps/lug-logo.png" ]; then
|
|
||||||
lug_logo="/usr/share/pixmaps/lug-logo.png"
|
|
||||||
elif [ -f "$helper_dir/lug-logo.png" ]; then
|
|
||||||
lug_logo="$helper_dir/lug-logo.png"
|
|
||||||
else
|
|
||||||
lug_logo="info"
|
|
||||||
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
|
|
||||||
|
|
||||||
######## Runners ###########################################################
|
######## Runners ###########################################################
|
||||||
|
|
||||||
# Lutris native wine runners directory
|
# Lutris native wine runners directory
|
||||||
@ -198,17 +184,25 @@ dxvk_sources=(
|
|||||||
"/dev/null" "https://api.github.com/repos/gort818/dxvk/releases"
|
"/dev/null" "https://api.github.com/repos/gort818/dxvk/releases"
|
||||||
)
|
)
|
||||||
|
|
||||||
######## Requirements ######################################################
|
######## Bundled Files #####################################################
|
||||||
|
|
||||||
# winetricks minimum version
|
# Use logo installed by a packaged version of this script if available
|
||||||
winetricks_required="20220411"
|
# Otherwise, default to the logo in the same directory
|
||||||
|
if [ -f "/usr/share/pixmaps/lug-logo.png" ]; then
|
||||||
|
lug_logo="/usr/share/pixmaps/lug-logo.png"
|
||||||
|
elif [ -f "$helper_dir/lug-logo.png" ]; then
|
||||||
|
lug_logo="$helper_dir/lug-logo.png"
|
||||||
|
else
|
||||||
|
lug_logo="info"
|
||||||
|
fi
|
||||||
|
|
||||||
# lutris minimum version
|
# Use Lutris install script installed by a packaged version of this script if available
|
||||||
lutris_required="0.5.11"
|
# Otherwise, default to the json in the same directory
|
||||||
|
if [ -f "/usr/share/lug-helper/lug-lutris-install.json" ]; then
|
||||||
# Minimum amount of combined RAM + swap in GiB
|
install_script="/usr/share/lug-helper/lug-lutris-install.json"
|
||||||
memory_required="16"
|
else
|
||||||
memory_combined_required="40"
|
install_script="$helper_dir/lug-lutris-install.json"
|
||||||
|
fi
|
||||||
|
|
||||||
######## Links #############################################################
|
######## Links #############################################################
|
||||||
|
|
||||||
@ -218,7 +212,7 @@ lug_wiki="https://starcitizen-lug.github.io"
|
|||||||
# Github repo and script version info
|
# Github repo and script version info
|
||||||
repo="starcitizen-lug/lug-helper"
|
repo="starcitizen-lug/lug-helper"
|
||||||
releases_url="https://github.com/$repo/releases"
|
releases_url="https://github.com/$repo/releases"
|
||||||
current_version="v2.6"
|
current_version="v2.5"
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -899,33 +893,13 @@ winetricks_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check system memory and swap space
|
# Check total system memory
|
||||||
memory_check() {
|
memory_check() {
|
||||||
# Get totals in bytes
|
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf "%.1f \n", $2/1024/1024}' /proc/meminfo)"
|
||||||
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf $2}' /proc/meminfo)"
|
if [ "${memtotal%.*}" -ge "15" ]; then
|
||||||
swaptotal="$(LC_NUMERIC=C awk '/SwapTotal/ {printf $2}' /proc/meminfo)"
|
preflight_pass+=("Your system has $memtotal GB of memory.")
|
||||||
memtotal="$(($memtotal * 1024))"
|
|
||||||
swaptotal="$(($swaptotal * 1024))"
|
|
||||||
combtotal="$(($memtotal + $swaptotal))"
|
|
||||||
|
|
||||||
# Convert to GiB
|
|
||||||
memtotal="$(numfmt --to=iec-i --suffix="B" "$memtotal")"
|
|
||||||
swaptotal="$(numfmt --to=iec-i --suffix="B" "$swaptotal")"
|
|
||||||
combtotal="$(numfmt --to=iec-i --suffix="B" "$combtotal")"
|
|
||||||
|
|
||||||
if [ "${memtotal: -3}" != "GiB" ] || [ "${memtotal::-3}" -lt "$memory_required" ]; then
|
|
||||||
# Minimum requirements are not met
|
|
||||||
preflight_fail+=("Your system has $memtotal of memory.\n${memory_required}GiB is the minimum required to avoid crashes.")
|
|
||||||
elif [ "${memtotal::-3}" -ge "$memory_combined_required" ]; then
|
|
||||||
# System has sufficient RAM
|
|
||||||
preflight_pass+=("Your system has $memtotal of memory.")
|
|
||||||
elif [ "${combtotal::-3}" -ge "$memory_combined_required" ]; then
|
|
||||||
# System has sufficient combined RAM + swap
|
|
||||||
preflight_pass+=("Your system has $memtotal memory and $swaptotal swap.")
|
|
||||||
else
|
else
|
||||||
# Recommend swap
|
preflight_fail+=("Your system has $memtotal GB of memory.\nWe recommend at least 16 GB to avoid crashes.")
|
||||||
swap_recommended="$(($memory_combined_required - ${memtotal::-3}))"
|
|
||||||
preflight_fail+=("Your system has $memtotal memory and $swaptotal swap.\nWe recommend at least ${swap_recommended}GiB swap to avoid crashes.")
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,6 +912,15 @@ avx_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if swap is set up
|
||||||
|
swap_check() {
|
||||||
|
if grep -vq "Filename" /proc/swaps; then
|
||||||
|
preflight_pass+=("You have swap space configured.")
|
||||||
|
else
|
||||||
|
preflight_fail+=("You don't appear to have swap space configured.\nWe recommend configuring an 8-16 GB swap file.")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Check that the system is optimized for Star Citizen
|
# Check that the system is optimized for Star Citizen
|
||||||
preflight_check() {
|
preflight_check() {
|
||||||
# Initialize variables
|
# Initialize variables
|
||||||
@ -954,6 +937,7 @@ preflight_check() {
|
|||||||
wine_check
|
wine_check
|
||||||
winetricks_check
|
winetricks_check
|
||||||
memory_check
|
memory_check
|
||||||
|
swap_check
|
||||||
avx_check
|
avx_check
|
||||||
mapcount_check
|
mapcount_check
|
||||||
filelimit_check
|
filelimit_check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user