From 3b19f5f26c386f6e1b1671ddf1b91fd7f9c3679a Mon Sep 17 00:00:00 2001 From: shenmo Date: Wed, 26 Feb 2025 11:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scale-set-helper/get-scale.sh | 21 +++++-------------- .../scale-set-helper/set-wine-scale.sh | 8 +++---- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/get-scale.sh b/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/get-scale.sh index 1be1b6b..e280b82 100755 --- a/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/get-scale.sh +++ b/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/get-scale.sh @@ -19,20 +19,11 @@ Get_Dist_Name() } ######<<<<<<< -if [ $# -lt 1 ]; then -echo "无参数,无法启动。这是一个set-wine-scale的组件,一般来说,你不会需要单独启动这个脚本" -echo "请参考set-wine-scale.sh使用" -echo "参数为CONTAINER_PATH" -echo "只读取第一个,其他参数会被放弃" -fi -CONTAINER_PATH="$1" +echo 全局参数的位置在$HOME/.config/spark-wine/scale.txt,如果需要更换请删除此文件重新生成 + + -if [ ! -f "$CONTAINER_PATH/user.reg" ];then - echo "错误:找不到user.reg,退出。你应当在文件解压结束后调用此脚本" - echo "E: Can not find user.reg. Exit. You should use this script after the extraction" - exit 1 -fi mkdir -p $HOME/.config/spark-wine/ @@ -41,8 +32,7 @@ mkdir -p $HOME/.config/spark-wine/ ##### if [ -f "$HOME/.config/spark-wine/scale.txt" ];then - cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt - echo "检测到已经设置过全局参数,直接复制" + echo "已经设置过全局参数,使用" echo "全局参数的位置在$HOME/.config/spark-wine/scale.txt,如果需要更换请删除此文件重新生成" exit fi @@ -51,7 +41,6 @@ fi Get_Dist_Name if [ "$DISTRO" = "UniontechOS" ] || [ "$DISTRO" = "GXDE" ];then echo 1.0 > $HOME/.config/spark-wine/scale.txt -cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt #####就是1倍缩放 exit fi @@ -84,5 +73,5 @@ zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CO ;; esac echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt -cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt + diff --git a/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh b/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh index 06b20e8..bacb701 100755 --- a/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh +++ b/spark-dwine-helper/s-wine-helper/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh @@ -55,18 +55,16 @@ if [ "$appointed_scale_factor" = "" ];then if [ ! -f "$CONTAINER_PATH/scale.txt" ];then - echo "E: No SCALE profile found. try to use DEEPIN_WINE_SCALE" - echo "错误:没有检测到缩放设置,读取DEEPIN_WINE_SCALE" + if [ "$DEEPIN_WINE_SCALE" = "" ];then echo "E: No DEEPIN_WINE_SCALE found. Use get-scale.sh to Set " echo "错误:没有检测到DEEPIN_WINE_SCALE,用get-scale.sh设置" ${SHELL_DIR}/spark-dwine-helper/scale-set-helper/get-scale.sh "$CONTAINER_PATH" - wine_scale=`cat $CONTAINER_PATH/scale.txt` + wine_scale=$(cat $HOME/.config/spark-wine/scale.txt) echo "检测到的缩放倍数为:$wine_scale" echo "Scale is $wine_scale" else - echo "$DEEPIN_WINE_SCALE" > $CONTAINER_PATH/scale.txt - wine_scale=`cat $CONTAINER_PATH/scale.txt` + wine_scale=$DEEPIN_WINE_SCALE echo "检测到的缩放倍数为:$wine_scale" echo "Scale is $wine_scale" fi