From 8a44b8da17e7fd0c4129dd01a1e94a1d4f2b4ce6 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sun, 22 Oct 2023 13:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=BE=83=E5=A4=A7=E7=9A=84=E5=BA=94=E7=94=A8=E8=A7=A3=E5=8C=85?= =?UTF-8?q?=E4=B8=AD=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deepinwine/tools/spark_run_v4.sh | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh index 34bf6ad..90dafff 100755 --- a/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh +++ b/spark-dwine-helper/s-wine-helper/deepinwine/tools/spark_run_v4.sh @@ -37,7 +37,20 @@ if [ $SPECIFY_SHELL_DIR ]; then SHELL_DIR=$SPECIFY_SHELL_DIR fi +# Check if some visual feedback is possible +if command -v zenity >/dev/null 2>&1; then + progressbar() + { + WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close --no-cancel || + WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close + } +else + progressbar() + { + cat - + } +fi _DeleteRegistry() { @@ -213,7 +226,8 @@ fi ExtractApp() { mkdir -p "$1" - 7z x "$APPDIR/$APPTAR" -o"$1" -bsp1 -bb1 -bse2 | grep --line-buffered -oP "(\d+(\.\d+)?(?=%))" | zenity --progress --title="$BOTTLENAME" --text="${TRANSHELL_CONTENT_UNPACKING} $BOTTLENAME..." --width=400 --auto-close --no-cancel +# 7z x "$APPDIR/$APPTAR" -o"$1" -bsp1 -bb1 -bse2 | grep --line-buffered -oP "(\d+(\.\d+)?(?=%))" | zenity --progress --title="$BOTTLENAME" --text="${TRANSHELL_CONTENT_UNPACKING} $BOTTLENAME..." --width=400 --auto-close --no-cancel + 7z x "$APPDIR/$APPTAR" -o"$1" mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER" sed -i "s#@current_user@#$USER#" $1/*.reg FixLink @@ -273,9 +287,9 @@ RunApp() exit 0 fi if [ -d "$WINEPREFIX" ]; then - UpdateApp + UpdateApp | progressbar "$BOTTLENAME" "${TRANSHELL_CONTENT_UNPACKING} $BOTTLENAME..." else - DeployApp + DeployApp | progressbar "$BOTTLENAME" "${TRANSHELL_CONTENT_UNPACKING} $BOTTLENAME..." fi CallApp "$@"