mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 23:31:52 +01:00
Update NonSteamLaunchers.sh
This commit is contained in:
parent
43034167e8
commit
3422b13fdb
@ -2269,7 +2269,6 @@ fi
|
|||||||
|
|
||||||
sleep 15
|
sleep 15
|
||||||
|
|
||||||
|
|
||||||
# Function to switch to Game Mode
|
# Function to switch to Game Mode
|
||||||
switch_to_game_mode() {
|
switch_to_game_mode() {
|
||||||
echo "Switching to Game Mode..."
|
echo "Switching to Game Mode..."
|
||||||
@ -2310,21 +2309,28 @@ fi
|
|||||||
set +x
|
set +x
|
||||||
|
|
||||||
if $DECKY_LOADER_EXISTS; then
|
if $DECKY_LOADER_EXISTS; then
|
||||||
USER_INPUT=$(zenity --forms --title="Authentication Required" --text="Decky Loader detected! $(if $NSL_PLUGIN_EXISTS; then echo 'NSL Plugin also detected and will be updated to the latest version 🚀.'; else echo 'But no NSL plugin :(. Would you like to inject it and go to Game Mode?
|
while true; do
|
||||||
'; fi) Please enter your password to proceed:" --separator="|" --add-password="Password")
|
USER_INPUT=$(zenity --forms --title="Authentication Required" --text="Decky Loader detected! $(if $NSL_PLUGIN_EXISTS; then echo 'NSL Plugin also detected and will be updated to the latest version 🚀.'; else echo 'But no NSL plugin :(. Would you like to inject it and go to Game Mode?'; fi) Please enter your sudo password to proceed:" --separator="|" --add-password="Password")
|
||||||
|
USER_PASSWORD=$(echo $USER_INPUT | cut -d'|' -f1)
|
||||||
|
|
||||||
|
if [ -z "$USER_PASSWORD" ]; then
|
||||||
|
zenity --error --text="No password entered. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$USER_PASSWORD" | sudo -S echo "Password accepted" 2>/dev/null
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
zenity --error --text="Incorrect password. Please try again."
|
||||||
|
fi
|
||||||
|
done
|
||||||
else
|
else
|
||||||
zenity --error --text="Decky Loader not detected. Please download and install it from their website first and re-run this script to get the NSL Plugin."
|
zenity --error --text="Decky Loader not detected. Please download and install it from their website first and re-run this script to get the NSL Plugin."
|
||||||
rm -rf "$download_dir"
|
rm -rf "$download_dir"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
USER_PASSWORD=$(echo $USER_INPUT | cut -d'|' -f1)
|
|
||||||
|
|
||||||
if [ -z "$USER_PASSWORD" ]; then
|
|
||||||
zenity --error --text="No password entered. Exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if $NSL_PLUGIN_EXISTS; then
|
if $NSL_PLUGIN_EXISTS; then
|
||||||
show_message "NSL Plugin detected. Deleting and updating..."
|
show_message "NSL Plugin detected. Deleting and updating..."
|
||||||
echo "Plugin directory exists. Removing..."
|
echo "Plugin directory exists. Removing..."
|
||||||
@ -2357,6 +2363,7 @@ sudo systemctl restart plugin_loader.service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: might be better to relocate temp files to `/tmp` or even use `mktemp -d` since `rm -rf` is potentially dangerous without the `-i` flag
|
# TODO: might be better to relocate temp files to `/tmp` or even use `mktemp -d` since `rm -rf` is potentially dangerous without the `-i` flag
|
||||||
|
|
||||||
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder
|
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder
|
||||||
|
Loading…
Reference in New Issue
Block a user