From 08d12d068e788745d3287d068aae3a6240b71937 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 16 Jul 2024 14:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=83=A8=E5=88=86=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=94=B9=E4=B8=BA=E7=9B=B8=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E4=BB=A5=E6=96=B9=E4=BE=BF=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wine-app-launcher/wine-app-launcher.sh | 12 +++++++----- .../files/deepinwine/tools/spark_gl-wine/run_gl.sh | 4 +++- .../files/deepinwine/tools/spark_run_v4.sh | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh b/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh index 65e4dd2..0b7f2a7 100755 --- a/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh +++ b/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh @@ -1,5 +1,7 @@ #!/bin/bash +SHELL_DIR=$(dirname $(realpath $0)) + # 函数:获取所有应用列表 # 函数:获取所有应用列表 get_apps_list() { @@ -26,7 +28,7 @@ get_apps_list() { version="无法读取" fi - if grep -q "START_SHELL_PATH=\"/opt/deepinwine/tools/spark_run_v4.sh\"" "$run_script"; then + if grep -q "START_SHELL_PATH=\"$SHELL_DIR/../spark_run_v4.sh\"" "$run_script"; then use_spark="是" fi fi @@ -63,7 +65,7 @@ select_app() { local app_dir="/opt/apps/$app" local run_script="$app_dir/files/run.sh" local use_spark="否" - if grep -q "START_SHELL_PATH=\"/opt/deepinwine/tools/spark_run_v4.sh\"" "$run_script"; then + if grep -q "START_SHELL_PATH=\"$SHELL_DIR/../spark_run_v4.sh\"" "$run_script"; then use_spark="是" fi if [ "$use_spark" == "是" ]; then @@ -95,7 +97,7 @@ select_non_spark_action(){ local app_dir="/opt/apps/$app" local run_script="$app_dir/files/run.sh" local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script") - /opt/deepinwine/tools/kill.sh ${bottle_name} + $SHELL_DIR/../kill.sh ${bottle_name} rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/* zenity --info --width=300 --text="操作已完成,请重启Wine应用查看" ;; @@ -138,7 +140,7 @@ select_spark_action() { local app_dir="/opt/apps/$app" local run_script="$app_dir/files/run.sh" local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script") - /opt/deepinwine/tools/spark_kill.sh ${bottle_name} + $SHELL_DIR/../spark_kill.sh ${bottle_name} rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/* zenity --info --width=300 --text="操作已完成,请重启Wine应用查看" ;; @@ -181,7 +183,7 @@ select_scale_action() { if [ "$scale_factor" == "恢复默认" ];then rm $HOME/.deepinwine/$bottle_name/scale.txt else - /opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s "$scale_factor" "$HOME/.deepinwine/$bottle_name" + $SHELL_DIR/scale-set-helper/set-wine-scale.sh -s "$scale_factor" "$HOME/.deepinwine/$bottle_name" fi elif [ "$scale_type" == "全局" ]; then if [ "$scale_factor" == "恢复默认" ];then diff --git a/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_gl-wine/run_gl.sh b/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_gl-wine/run_gl.sh index 68118a9..34b38b8 100755 --- a/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_gl-wine/run_gl.sh +++ b/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_gl-wine/run_gl.sh @@ -2,7 +2,9 @@ cd $(dirname $0) -runtime_path=/opt/deepinwine/runtime-i386 +SHELL_DIR=$(dirname $(realpath $0)) +runtime_path=$SHELL_DIR/../../runtime-i386 +echo $runtime_path if [ -f "$runtime_path/init_runtime.sh" ];then source "$runtime_path/init_runtime.sh" diff --git a/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_run_v4.sh b/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_run_v4.sh index b3143e9..4d87919 100755 --- a/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_run_v4.sh +++ b/spark-dwine-helper/s-wine-helper/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_run_v4.sh @@ -178,7 +178,7 @@ DisableWrite() ########如果有该文件夹则删除,然后再创建一个不允许写入的 is_autostart() { - AUTOSTART="/opt/deepinwine/tools/autostart" + AUTOSTART="$SHELL_DIR/autostart" if [ -f "$AUTOSTART.all" ]&&[ -f "/opt/apps/$1/files/run.sh" ];then return 0 fi