summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2023-03-20 21:50:33 +0000
committerGitHub <noreply@github.com>2023-03-20 21:50:33 +0000
commit4eb24eed9de7f1077a101e699be0270efa3eac16 (patch)
treef0d3bb5e5375e146967ab7d25b1e998f16a42aec
parentfe89c471338a8625c3f86763ce79838916b1e38c (diff)
downloaddecky-installer-4eb24eed9de7f1077a101e699be0270efa3eac16.tar.gz
decky-installer-4eb24eed9de7f1077a101e699be0270efa3eac16.zip
remove GTK errors and re-add useful errors
-rw-r--r--gui/user_install_script.sh35
1 files changed, 20 insertions, 15 deletions
diff --git a/gui/user_install_script.sh b/gui/user_install_script.sh
index c12e1fb..c5be17c 100644
--- a/gui/user_install_script.sh
+++ b/gui/user_install_script.sh
@@ -5,6 +5,11 @@ temp_pass_cleanup() {
echo $PASS | sudo -S -k passwd -d deck
}
+# removes unhelpful GTK warnings
+zen_nospam() {
+ zenity 2> >(grep -v 'GtkDialog' >&2) "$@"
+}
+
# check if JQ is installed
if ! command -v jq &> /dev/null
then
@@ -21,7 +26,7 @@ if (( $EUID != 0 )); then
fi
if [ "${PASS_STATUS:5:2}" = "NP" ]; then # if no password is set
- if ( zenity --title="Decky Installer" --width=300 --height=200 --question --text="You appear to have not set an admin password.\nDecky can still install by temporarily setting your password to 'Decky!' and continuing, then removing it when the installer finishes\nAre you okay with that?" ); then
+ if ( zen_nospam --title="Decky Installer" --width=300 --height=200 --question --text="You appear to have not set an admin password.\nDecky can still install by temporarily setting your password to 'Decky!' and continuing, then removing it when the installer finishes\nAre you okay with that?" ); then
yes "Decky!" | passwd deck
trap temp_pass_cleanup EXIT # make sure password is removed when application closes
PASS="Decky!"
@@ -30,24 +35,24 @@ if (( $EUID != 0 )); then
# get password
FINISHED="false"
while [ "$FINISHED" != "true" ]; do
- PASS=$(zenity --title="Decky Installer" --width=300 --height=100 --entry --hide-text --text="Enter your sudo/admin password")
+ PASS=$(zen_nospam --title="Decky Installer" --width=300 --height=100 --entry --hide-text --text="Enter your sudo/admin password")
if [[ $? -eq 1 ]] || [[ $? -eq 5 ]]; then
exit 1
fi
if ( echo "$PASS" | sudo -S -k true ); then
FINISHED="true"
else
- zenity --title="Decky Installer" --width=150 --height=40 --info --text "Incorrect Password"
+ zen_nospam --title="Decky Installer" --width=150 --height=40 --info --text "Incorrect Password"
fi
done
fi
if ! [ $USER = "deck" ]; then
- zenity --title="Decky Installer" --width=300 --height=100 --warning --text "You appear to not be on a deck.\nDecky should still mostly work, but you may not get full functionality."
+ zen_nospam --title="Decky Installer" --width=300 --height=100 --warning --text "You appear to not be on a deck.\nDecky should still mostly work, but you may not get full functionality."
fi
# get user dir before rerunning as root, otherwise it'll just be 'home/root'
-
+
echo "$PASS" | sudo -S -k bash "$0" "$@" # rerun script as root
exit 1
fi
@@ -58,9 +63,9 @@ HOMEBREW_FOLDER="${USER_DIR}/homebrew"
# if decky is already installed, then also add an 'uninstall' prompt
if [[ -f "${USER_DIR}/homebrew/services/PluginLoader" ]] ; then
- BRANCH=$(zenity --title="Decky Installer" --width=360 --height=170 --list --radiolist --text "Select Option:" --hide-header --column "Buttons" --column "Choice" --column "Info" TRUE "release" "(Recommended option)" FALSE "prerelease" "(May be unstable)" FALSE "uninstall decky loader" "")
+ BRANCH=$(zen_nospam --title="Decky Installer" --width=360 --height=170 --list --radiolist --text "Select Option:" --hide-header --column "Buttons" --column "Choice" --column "Info" TRUE "release" "(Recommended option)" FALSE "prerelease" "(May be unstable)" FALSE "uninstall decky loader" "")
else
- BRANCH=$(zenity --title="Decky Installer" --width=300 --height=100 --list --radiolist --text "Select Branch:" --hide-header --column "Buttons" --column "Choice" --column "Info" TRUE "release" "(Recommended option)" FALSE "prerelease" "(May be unstable)" )
+ BRANCH=$(zen_nospam --title="Decky Installer" --width=300 --height=100 --list --radiolist --text "Select Branch:" --hide-header --column "Buttons" --column "Choice" --column "Info" TRUE "release" "(Recommended option)" FALSE "prerelease" "(May be unstable)" )
fi
if [[ $? -eq 1 ]] || [[ $? -eq 5 ]]; then
exit 1
@@ -86,7 +91,7 @@ if [ "$BRANCH" == "uninstall decky loader" ] ; then
echo "100" ; echo "# Uninstall finished, installer can now be closed";
) |
- zenity --progress \
+ zen_nospam --progress \
--title="Decky Installer" \
--width=300 --height=100 \
--text="Uninstalling..." \
@@ -113,15 +118,15 @@ VERSION=$(jq -r '.tag_name' <<< ${RELEASE} )
DOWNLOADURL=$(jq -r '.assets[].browser_download_url | select(endswith("PluginLoader"))' <<< ${RELEASE})
echo "45" ; echo "# Installing version $VERSION" ;
-curl -L $DOWNLOADURL -o ${HOMEBREW_FOLDER}/services/PluginLoader 2>&1 | stdbuf -oL tr '\r' '\n' | sed -u 's/^ *\([0-9][0-9]*\).*\( [0-9].*$\)/\1\n#Download Speed\:\2/' | zenity --progress --title "Downloading Decky" --text="Download Speed: 0" --width=300 --height=100 --auto-close --no-cancel 2>/dev/null
+curl -L $DOWNLOADURL -o ${HOMEBREW_FOLDER}/services/PluginLoader 2>&1 | stdbuf -oL tr '\r' '\n' | sed -u 's/^ *\([0-9][0-9]*\).*\( [0-9].*$\)/\1\n#Download Speed\:\2/' | zen_nospam --progress --title "Downloading Decky" --text="Download Speed: 0" --width=300 --height=100 --auto-close --no-cancel
chmod +x ${HOMEBREW_FOLDER}/services/PluginLoader
echo $VERSION > ${HOMEBREW_FOLDER}/services/.loader.version
echo "70" ; echo "# Kiling plugin_loader if it exists" ;
-systemctl --user stop plugin_loader 2> /dev/null
-systemctl --user disable plugin_loader 2> /dev/null
-systemctl stop plugin_loader 2> /dev/null
-systemctl disable plugin_loader 2> /dev/null
+systemctl --user stop plugin_loader
+systemctl --user disable plugin_loader
+systemctl stop plugin_loader
+systemctl disable plugin_loader
echo "85" ; echo "# Setting up systemd" ;
curl -L https://raw.githubusercontent.com/SteamDeckHomebrew/decky-loader/main/dist/plugin_loader-${BRANCH}.service --output ${HOMEBREW_FOLDER}/services/plugin_loader-${BRANCH}.service
@@ -172,7 +177,7 @@ fi
echo "100" ; echo "# Install finished, installer can now be closed";
) |
-zenity --progress \
+zen_nospam --progress \
--title="Decky Installer" \
--width=300 --height=100 \
--text="Installing..." \
@@ -180,5 +185,5 @@ zenity --progress \
--no-cancel # not actually sure how to make the cancel work properly, so it's just not there unless someone else can figure it out
if [ "$?" = -1 ] ; then
- zenity --title="Decky Installer" --width=150 --height=70 --error --text="Download interrupted."
+ zen_nospam --title="Decky Installer" --width=150 --height=70 --error --text="Download interrupted."
fi