From 1af2d8e446d818707986c441b3eeda98760e49a2 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 6 May 2024 10:41:38 +0800 Subject: [PATCH] add:clean bottle --- .../wine-app-launcher/wine-app-launcher.sh | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/spark-dwine-helper/s-wine-helper/opt/durapps/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh b/spark-dwine-helper/s-wine-helper/opt/durapps/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh index 8169e60..bb22f8a 100755 --- a/spark-dwine-helper/s-wine-helper/opt/durapps/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh +++ b/spark-dwine-helper/s-wine-helper/opt/durapps/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh @@ -77,7 +77,7 @@ select_app() { select_non_spark_action(){ local app="$1" local app_name="$2" - local options=("在终端中打开") + local options=("在终端中打开" "打开容器目录" "清理并重置容器目录") local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}") case "$choice" in "在终端中打开") @@ -85,6 +85,20 @@ select_non_spark_action(){ local run_script="$app_dir/files/run.sh" x-terminal-emulator -e "$run_script" ;; + "打开容器目录") + local app_dir="/opt/apps/$app" + local run_script="$app_dir/files/run.sh" + local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script") + xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name} + ;; + "清理并重置容器目录") + 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} + rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/* + zenity --info --width=300 --text="操作已完成,请重启Wine应用查看" + ;; esac } @@ -92,7 +106,7 @@ select_non_spark_action(){ select_spark_action() { local app="$1" local app_name="$2" - local options=("在终端中打开" "修改应用缩放" "修改全局缩放") + local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "修改应用缩放" "修改全局缩放") local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}") case "$choice" in @@ -101,6 +115,20 @@ select_spark_action() { local run_script="$app_dir/files/run.sh" x-terminal-emulator -e "$run_script" ;; + "打开容器目录") + local app_dir="/opt/apps/$app" + local run_script="$app_dir/files/run.sh" + local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script") + xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name} + ;; + "清理并重置容器目录") + 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} + rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/* + zenity --info --width=300 --text="操作已完成,请重启Wine应用查看" + ;; "修改应用缩放") select_scale_action "应用" "$app" ;;