mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-01 13:50:35 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
675621c4c3 | |||
c07e673c0d | |||
b85df29d6d | |||
7f3d84a8bc | |||
6533cf98bd | |||
c7c8cd1ecd | |||
e0d149494d | |||
9800420d73 |
@ -106,6 +106,8 @@ runners_dir="$data_dir/lutris/runners/wine"
|
||||
runner_sources=(
|
||||
"RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
||||
"Molotov/Snatella" "https://api.github.com/repos/snatella/wine-runner-sc/releases"
|
||||
"/dev/null" "https://api.github.com/repos/gort818/wine-sc-lug/releases"
|
||||
"GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases"
|
||||
)
|
||||
# Set a maximum number of runner versions to display from each url
|
||||
max_runners=20
|
||||
@ -663,7 +665,7 @@ filelimit_check() {
|
||||
|
||||
# Check total system memory
|
||||
memory_check() {
|
||||
memtotal="$(awk '/MemTotal/ {printf "%.1f \n", $2/1024/1024}' /proc/meminfo)"
|
||||
memtotal="$(LC_NUMERIC=C awk '/MemTotal/ {printf "%.1f \n", $2/1024/1024}' /proc/meminfo)"
|
||||
if [ ${memtotal%.*} -ge "15" ]; then
|
||||
preflight_pass+=("Your system has $memtotal GB of memory.")
|
||||
else
|
||||
@ -819,6 +821,12 @@ runner_install() {
|
||||
*.tgz)
|
||||
runner_name="$(basename "$runner_file" .tgz)"
|
||||
;;
|
||||
*.tar.xz)
|
||||
runner_name="$(basename "$runner_file" .tar.xz)"
|
||||
;;
|
||||
*.sha512sum)
|
||||
runner_name="$(basename "$runner_file" .tar.xz)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in runner_install function. Aborting."
|
||||
;;
|
||||
@ -829,6 +837,7 @@ runner_install() {
|
||||
# runner_select_install function below
|
||||
if [ "$runner_url_type" = "github" ]; then
|
||||
runner_dl_url="$(curl -s "$contributor_url" | grep "browser_download_url.*$runner_file" | cut -d \" -f4)"
|
||||
debug_print continue "runner_dl_url= $runner_dl_url"
|
||||
else
|
||||
debug_print exit "Script error: Unknown api/url format in runner_sources array. Aborting."
|
||||
fi
|
||||
@ -882,10 +891,10 @@ runner_install() {
|
||||
debug_print continue "Installing runner into $runners_dir/$runner_name..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir -p "$runners_dir/$runner_name" && tar -xzf "$tmp_dir/$runner_file" -C "$runners_dir/$runner_name" | \
|
||||
mkdir -p "$runners_dir/$runner_name" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir/$runner_name" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing runner...\n" 2>/dev/null
|
||||
else
|
||||
mkdir -p "$runners_dir/$runner_name" && tar -xzf "$tmp_dir/$runner_file" -C "$runners_dir/$runner_name"
|
||||
mkdir -p "$runners_dir/$runner_name" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir/$runner_name"
|
||||
fi
|
||||
lutris_needs_restart="true"
|
||||
;;
|
||||
@ -894,10 +903,10 @@ runner_install() {
|
||||
debug_print continue "Installing runner into $runners_dir..."
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
# Use Zenity progress bar
|
||||
mkdir -p "$runners_dir" && tar -xzf "$tmp_dir/$runner_file" -C "$runners_dir" | \
|
||||
mkdir -p "$runners_dir" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir" | \
|
||||
zenity --progress --pulsate --no-cancel --auto-close --title="Star Citizen LUG Helper" --text="Installing runner...\n" 2>/dev/null
|
||||
else
|
||||
mkdir -p "$runners_dir" && tar -xzf "$tmp_dir/$runner_file" -C "$runners_dir"
|
||||
mkdir -p "$runners_dir" && tar -xf "$tmp_dir/$runner_file" -C "$runners_dir"
|
||||
fi
|
||||
lutris_needs_restart="true"
|
||||
;;
|
||||
@ -931,6 +940,18 @@ runner_select_install() {
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check for GlibC-Version if TKG is selected, as he requires 2.33
|
||||
if [ "$contributor_url" = "https://api.github.com/repos/gort818/wine-sc-lug/releases" ]; then
|
||||
printf "checking for glibc \n"
|
||||
system_glibc=($(ldd --version | awk '/ldd/{print $NF}'))
|
||||
printf "system glibc-versuib: $system_glibc \n"
|
||||
required_glibc="2.33"
|
||||
if [ "$(bc <<< "$required_glibc>$system_glibc")" == "1" ]; then
|
||||
message warning "Your glibc version is too low, /dev/null requires v$required_glibc "
|
||||
proton_manage
|
||||
fi
|
||||
fi
|
||||
|
||||
# Fetch a list of runner versions from the selected contributor
|
||||
# To add new sources, handle them here, in the if statement
|
||||
# just above, and the runner_install function above
|
||||
@ -967,13 +988,18 @@ runner_select_install() {
|
||||
*.tgz)
|
||||
runner_name="$(basename "${runner_versions[i]}" .tgz)"
|
||||
;;
|
||||
*.tar.xz)
|
||||
runner_name="$(basename "${runner_versions[i]}" .tar.xz)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in runner_select_install function. Aborting."
|
||||
runner_name="skip"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Add the runner names to the menu
|
||||
if [ -d "$runners_dir/$runner_name" ]; then
|
||||
if [ "$runner_name" = "skip" ]; then
|
||||
continue
|
||||
elif [ -d "$runners_dir/$runner_name" ]; then
|
||||
menu_options+=("$runner_name [installed]")
|
||||
else
|
||||
menu_options+=("$runner_name")
|
||||
@ -1235,6 +1261,24 @@ fi
|
||||
live_or_ptu="$live_dir"
|
||||
lutris_needs_restart="false"
|
||||
|
||||
# Credits for this go to https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
|
||||
get_latest_release() {
|
||||
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
|
||||
}
|
||||
|
||||
# Check if a new Verison of the script is available
|
||||
repo="the-sane/lug-helper"
|
||||
current_version="v1.9.1"
|
||||
latest_version=$(get_latest_release "$repo")
|
||||
|
||||
if [ "$latest_version" != "$current_version" ]; then
|
||||
# Print to stdout and also try warning the user through message
|
||||
printf "New version available, check https://github.com/the-sane/lug-helper/releases \n"
|
||||
message info "New version available, check <a href='https://github.com/the-sane/lug-helper/releases'>https://github.com/the-sane/lug-helper/releases</a> \n"
|
||||
fi
|
||||
|
||||
# If invoked with command line arguments, process them and exit
|
||||
if [ "$#" -gt 0 ]; then
|
||||
while [ "$#" -gt 0 ]
|
||||
|
Reference in New Issue
Block a user