mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2025-12-18 21:11:39 +08:00
精简代码
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user