mirror of
https://github.com/the-sane/lug-helper.git
synced 2024-12-29 09:14:19 +00:00
Offer Lutris restart only if changes were made
This commit is contained in:
parent
32fdc04ec7
commit
224c531d64
@ -640,19 +640,16 @@ rm_vidcache() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
mainmenu() {
|
|
||||||
#message info "Aborting - going back to Mainmenu"
|
|
||||||
echo "going back to menu"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Restart lutris
|
# Restart lutris
|
||||||
lutris_restart() {
|
lutris_restart() {
|
||||||
if message question "Lutris must be restarted to refresh the downloaded runners.\nWould you like this helper to restart it for you?"; then
|
if [ "$runners_modified" = "true" ]; then
|
||||||
if [ "$(pgrep lutris)" ]; then
|
if message question "Lutris must be restarted to detect runner changes.\nWould you like this helper to restart it for you?"; then
|
||||||
echo -e "\nRestarting Lutris...\n"
|
if [ "$(pgrep lutris)" ]; then
|
||||||
pkill -SIGTERM lutris && nohup lutris </dev/null &>/dev/null &
|
echo -e "\nRestarting Lutris...\n"
|
||||||
else
|
pkill -SIGTERM lutris && nohup lutris </dev/null &>/dev/null &
|
||||||
message info "Lutris does not appear to be running."
|
else
|
||||||
|
message info "Lutris does not appear to be running."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -670,10 +667,8 @@ runner_delete() {
|
|||||||
if message question "Are you sure you want to delete the following runner?\n\n${installed_runners[$runner_to_delete]}"; then
|
if message question "Are you sure you want to delete the following runner?\n\n${installed_runners[$runner_to_delete]}"; then
|
||||||
rm -r "${installed_runners[$runner_to_delete]}"
|
rm -r "${installed_runners[$runner_to_delete]}"
|
||||||
echo -e "\nDeleted ${installed_runners[$runner_to_delete]}\n"
|
echo -e "\nDeleted ${installed_runners[$runner_to_delete]}\n"
|
||||||
|
runners_modified="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart Lutris
|
|
||||||
lutris_restart
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# List installed runners for deletion
|
# List installed runners for deletion
|
||||||
@ -734,14 +729,13 @@ runner_install() {
|
|||||||
# Runners without a subdirectory in the archive
|
# Runners without a subdirectory in the archive
|
||||||
echo -e "\nDownloading $runner_url\ninto $runner_dir/$runner_name\n"
|
echo -e "\nDownloading $runner_url\ninto $runner_dir/$runner_name\n"
|
||||||
mkdir -p "$runner_dir/$runner_name" && curl -L "$runner_url" | tar -xzf - -C "$runner_dir/$runner_name"
|
mkdir -p "$runner_dir/$runner_name" && curl -L "$runner_url" | tar -xzf - -C "$runner_dir/$runner_name"
|
||||||
|
runners_modified="true"
|
||||||
else
|
else
|
||||||
# Runners with a subdirectory in the archive
|
# Runners with a subdirectory in the archive
|
||||||
echo -e "\nDownloading $runner_url\ninto $runner_dir\n"
|
echo -e "\nDownloading $runner_url\ninto $runner_dir\n"
|
||||||
mkdir -p "$runner_dir" && curl -L "$runner_url" | tar -xzf - -C "$runner_dir"
|
mkdir -p "$runner_dir" && curl -L "$runner_url" | tar -xzf - -C "$runner_dir"
|
||||||
|
runners_modified="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart Lutris
|
|
||||||
lutris_restart
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# List available runners for download
|
# List available runners for download
|
||||||
@ -830,7 +824,7 @@ runner_manage() {
|
|||||||
# Set the options to be displayed in the menu
|
# Set the options to be displayed in the menu
|
||||||
menu_options=("$rawfox" "$snatella" "$delete" "$back")
|
menu_options=("$rawfox" "$snatella" "$delete" "$back")
|
||||||
# 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=("runner_select_install rawfox" "runner_select_install snatella" "runner_select_delete" "mainmenu")
|
menu_actions=("runner_select_install rawfox" "runner_select_install snatella" "runner_select_delete" "lutris_restart")
|
||||||
|
|
||||||
# Call the menu function. It will use the options as configured above
|
# Call the menu function. It will use the options as configured above
|
||||||
menu
|
menu
|
||||||
@ -865,8 +859,9 @@ if [ -x "$(command -v zenity)" ]; then
|
|||||||
has_zen=1
|
has_zen=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Default to LIVE
|
# Set some defaults
|
||||||
live_or_ptu="LIVE"
|
live_or_ptu="LIVE"
|
||||||
|
runners_modified="false"
|
||||||
|
|
||||||
# Loop the main menu until the user selects quit
|
# Loop the main menu until the user selects quit
|
||||||
while true; do
|
while true; do
|
||||||
|
Loading…
Reference in New Issue
Block a user