mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-05 12:43:30 +00:00
Compare commits
1 Commits
v1.13
...
1a415f9f1b
Author | SHA1 | Date | |
---|---|---|---|
1a415f9f1b |
@ -46,8 +46,6 @@
|
|||||||
# Contributor: https://github.com/Wrzlprnft
|
# Contributor: https://github.com/Wrzlprnft
|
||||||
# Runner Downloader inspired by:
|
# Runner Downloader inspired by:
|
||||||
# https://github.com/richardtatum/sc-runner-updater
|
# https://github.com/richardtatum/sc-runner-updater
|
||||||
#
|
|
||||||
# License: GPLv3.0
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# Check if script is run as root
|
# Check if script is run as root
|
||||||
@ -63,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)" ] || [ ! -x "$(command -v sort)" ]; then
|
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v basename)" ]; 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- sort (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" 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- sort (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" --icon=dialog-warning
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -107,7 +105,7 @@ runners_dir="$data_dir/lutris/runners/wine"
|
|||||||
# The second is expected to contain the github api releases url
|
# The second is expected to contain the github api releases url
|
||||||
# ie. "RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
# ie. "RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
||||||
runner_sources=(
|
runner_sources=(
|
||||||
"RawFox" "https://api.github.com/repos/starcitizen-lug/raw-wine/releases"
|
"RawFox" "https://api.github.com/repos/rawfoxDE/raw-wine/releases"
|
||||||
"Molotov/Snatella" "https://api.github.com/repos/snatella/wine-runner-sc/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"
|
"/dev/null" "https://api.github.com/repos/gort818/wine-sc-lug/releases"
|
||||||
"GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases"
|
"GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases"
|
||||||
@ -147,9 +145,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Github repo and script version info
|
# Github repo and script version info
|
||||||
repo="starcitizen-lug/lug-helper"
|
repo="the-sane/lug-helper"
|
||||||
releases_url="https://github.com/$repo/releases"
|
releases_url="https://github.com/the-sane/lug-helper/releases"
|
||||||
current_version="v1.13"
|
current_version="v1.11.1"
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -974,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
|
||||||
|
|
||||||
@ -1395,6 +1393,48 @@ preflight_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Deploy Easy Anti-Cheat Workaround
|
||||||
|
eac_workaround() {
|
||||||
|
# Get/set directory paths
|
||||||
|
getdirs
|
||||||
|
|
||||||
|
# Set the EAC directory path and hosts modification
|
||||||
|
eac_dir="$wine_prefix/drive_c/users/$USER/AppData/Roaming/EasyAntiCheat"
|
||||||
|
eac_hosts="127.0.0.1 modules-cdn.eac-prod.on.epicgames.com"
|
||||||
|
|
||||||
|
# Check if EAC is installed
|
||||||
|
if [ ! -d "$eac_dir" ]; then
|
||||||
|
message info "Easy Anti-Cheat does not appear to be installed.\nThere is nothing to do!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure message variables
|
||||||
|
eac_title="Easy Anti-Cheat Workaround"
|
||||||
|
eac_hosts_formatted="$eac_hosts"
|
||||||
|
eac_dir_formatted="$eac_dir"
|
||||||
|
if [ "$use_zenity" -eq 1 ]; then
|
||||||
|
eac_title="<b>$eac_title</b>"
|
||||||
|
eac_hosts_formatted="<i>$eac_hosts_formatted</i>"
|
||||||
|
eac_dir_formatted="<i>$eac_dir_formatted</i>"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if message question "$eac_title\n\nThe following entry will be added to /etc/hosts:\n$eac_hosts_formatted\n\nThe following directory will be deleted:\n$eac_dir_formatted\n\n\nTo revert these changes, delete the above line from\n/etc/hosts and relaunch the game\n\nDo you want to proceed?"; then
|
||||||
|
debug_print continue "Editing hosts file..."
|
||||||
|
|
||||||
|
# Use pollkit's pkexec for gui with a fallback to sudo
|
||||||
|
if [ -x "$(command -v pkexec)" ]; then
|
||||||
|
pkexec sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||||
|
else
|
||||||
|
sudo sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug_print continue "Deleting $eac_dir..."
|
||||||
|
rm -r "$eac_dir"
|
||||||
|
|
||||||
|
message info "Easy Anti-Cheat workaround has been deployed!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Show maintenance/troubleshooting options
|
# Show maintenance/troubleshooting options
|
||||||
maintenance_menu() {
|
maintenance_menu() {
|
||||||
# Loop the menu until the user selects quit
|
# Loop the menu until the user selects quit
|
||||||
@ -1433,7 +1473,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" "STAR-YD4Z-TQZV" "STAR-XLN7-9XNJ" "STAR-N62T-2R39" "STAR-3S3D-9HXQ" "STAR-TRZF-NMCV" "STAR-TLLJ-SMG4")
|
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")
|
||||||
# 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,8 +1539,7 @@ 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" ] &&
|
if [ "$latest_version" != "$current_version" ]; then
|
||||||
[ "$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
|
||||||
@ -1521,7 +1560,6 @@ 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
|
||||||
@ -1539,9 +1577,6 @@ 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")
|
||||||
;;
|
;;
|
||||||
@ -1613,6 +1648,7 @@ while true; do
|
|||||||
|
|
||||||
# Configure the menu options
|
# Configure the menu options
|
||||||
preflight_msg="Preflight Check (System Optimization)"
|
preflight_msg="Preflight Check (System Optimization)"
|
||||||
|
eac_msg="Deploy Easy Anti-Cheat Workaround"
|
||||||
runners_msg="Manage Lutris Runners"
|
runners_msg="Manage Lutris Runners"
|
||||||
dxvk_msg="Manage DXVK Versions"
|
dxvk_msg="Manage DXVK Versions"
|
||||||
maintenance_msg="Maintenance and Troubleshooting"
|
maintenance_msg="Maintenance and Troubleshooting"
|
||||||
@ -1620,9 +1656,9 @@ while true; do
|
|||||||
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" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg")
|
menu_options=("$preflight_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
|
||||||
menu_actions=("preflight_check" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit")
|
menu_actions=("preflight_check" "eac_workaround" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit")
|
||||||
|
|
||||||
# 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))"
|
||||||
|
Reference in New Issue
Block a user