Compare commits

...

4 Commits
1.4.1 ... 1.5.1

Author SHA1 Message Date
e6673676bd 修改: spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-scale.sh
修改:     spark-dwine-launch/run-template_v1.sh
2022-05-31 22:39:35 +08:00
01761b00ab 修改: spark-dwine-helper/pkg/DEBIAN/control
修改:     spark-dwine-helper/pkg/opt/deepinwine/tools/spark_run_v4.sh
	修改:     spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/set-dwine-scale.sh
2022-05-31 22:27:40 +08:00
c6c116c88d 修改: 支持直接 -s 设置 2022-05-31 21:50:24 +08:00
b1f482a5b1 修改: spark-dwine-helper/pkg/DEBIAN/control
修改:     spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/set-dwine-scale.sh
	修改:     spark-dwine-helper/pkg/opt/durapps/spark-dwine-helper/spark-get-scale.sh
2022-05-31 21:41:51 +08:00
5 changed files with 97 additions and 61 deletions

View File

@@ -1,5 +1,5 @@
Package: spark-dwine-helper
Version: 1.4.1
Version: 1.5.1
Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: 2293

View File

@@ -8,7 +8,7 @@
#
# Modifier: shenmo <shenmo@spark-app.store>
#
# diff: Now will run set-dwine-scale.sh in stage RunApp before CallApp
# diff: Now will run set-dwine-scale.sh in stage CallProcess before CallApp
# Deleted Deepin-* to simplify the script
#
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@"
@@ -171,7 +171,8 @@ CallProcess()
fi
debug_log_to_file "Starting process $* ..."
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
/opt/durapps/spark-dwine-helper/set-dwine-scale.sh "$WINEPREFIX"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
#start autobottle
@@ -377,14 +378,14 @@ CallTHS()
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
fi
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
CallProcess "$@"
}
CallQQGameV2()
{
debug_log "run $1"
$SHELL_DIR/kill.sh QQMicroGameBox block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" -action:force_download -appid:${2} -pid:8 -bin_version:1.1.2.4 -loginuin: &
CallProcess "$1" -action:force_download -appid:${2} -pid:8 -bin_version:1.1.2.4 -loginuin:
}
CallPsCs6()
@@ -410,7 +411,7 @@ CallPsCs6()
debug_log_to_file "Starting process $* ..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
CallProcess "$@"
}
#arg 1: exec file path
@@ -562,8 +563,6 @@ RunApp()
else
DeployApp | progressbar $BOTTLENAME "初始化$BOTTLENAME中..."
fi
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
/opt/durapps/spark-dwine-helper/set-dwine-scale.sh "$WINEPREFIX"
CallApp "$@"
}

View File

@@ -4,14 +4,14 @@ help() {
cat <<EOF
用法:$0 [-h|--help] [-s|--set-scale-factor] path
-h|--help 显示这个帮助
-s|--set-scale-factor 直接指定缩放。支持1.01.251.52.0
-s|--set-scale-factor 直接指定缩放。支持1.01.251.51.752.0
path 容器目录
--------------------------------------------------------------------
Usage: $0 [-h|--help] [-s|--set-scale-factor] path
-h|--help Show this text
-s|--set-scale-factor Set scale factor direcly. Support 1.01.251.52.0
-s|--set-scale-factor Set scale factor direcly. Support 1.01.251.51.752.0
path Wine Container directory path
@@ -27,7 +27,8 @@ parse_args() {
exit
;;
-s|--set-scale-factor)
scale_factor="$2"
appointed_scale_factor="$2"
;;
*)
CONTAINER_PATH="$1"
@@ -48,41 +49,54 @@ if [ ! -f "$CONTAINER_PATH/user.reg" ];then
fi
if [ "$scale_factor" = "" ];then
#########未指定下
until [ "$env_dwine_scale" != "" ];do
if [ "$appointed_scale_factor" = "" ];then
#########未指定下,读取$CONTAINER_PATH/scale.txt。如果没有优先$DEEPIN_WINE_SCALE设置然后是手动
env_dwine_scale=`echo $DEEPIN_WINE_SCALE`
if [ "$env_dwine_scale" = "" ];then
echo "E: No DEEPIN_WINE_SCALE found. Use spark-get-scale to Set "
echo "错误没有检测到DEEPIN_WINE_SCALE用spark-get-scale设置"
/opt/durapps/spark-dwine-helper/spark-get-scale.sh
env_dwine_scale=`cat ~/.config/spark-wine/scale.txt`
echo "检测到的缩放倍数为:$env_dwine_scale"
echo "Scale is $env_dwine_scale"
else
echo "检测到的缩放倍数为:$env_dwine_scale"
echo "Scale is $env_dwine_scale"
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 spark-get-scale to Set "
echo "错误没有检测到DEEPIN_WINE_SCALE用spark-get-scale设置"
/opt/durapps/spark-dwine-helper/spark-get-scale.sh "$CONTAINER_PATH"
wine_scale=`cat $CONTAINER_PATH/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`
echo "检测到的缩放倍数为:$wine_scale"
echo "Scale is $wine_scale"
fi
else
wine_scale=`cat $CONTAINER_PATH/scale.txt`
if [ -n "$DEEPIN_WINE_SCALE" ] && [ "$DEEPIN_WINE_SCALE" != "$wine_scale" ];then
zenity --info --text="检测到您的缩放设置和Deepin默认的不同。这可能是您的个人设置因此不会自动同步\n您可以删除$CONTAINER_PATH/scale.txt来同步设置" --width=500 --height=150 --timeout=5 &
fi
echo "检测到的缩放倍数为:$wine_scale"
echo "Scale is $wine_scale"
done
fi
#####非deepin发行版似乎没有这个变量暂时不清楚这个变量是哪个组件做的
else
#######指定了缩放倍数
echo "使用了--set-scale-factor直接指定"
echo "--set-scale-factor detected. Arrange directly"
if [ "$scale_factor" != "1.0" ] && [ "$scale_factor" != "1.25" ] && [ "$scale_factor" != "1.5" ] && [ "$scale_factor" != "2.0" ] ;then
echo "无法识别的倍数:$scale_factor,请参看$0 -h"
if [ "$appointed_scale_factor" != "1.0" ] && [ "$appointed_scale_factor" != "1.25" ] && [ "$appointed_scale_factor" != "1.5" ] && [ "$appointed_scale_factor" != "1.75" ] && [ "$appointed_scale_factor" != "2.0" ] ;then
echo "无法识别的倍数:$appointed_scale_factor,请参看$0 -h"
echo "Unrecognizable number. Use $0 -h to get help"
exit 1
fi
#######没问题了再用
env_dwine_scale=`echo $scale_factor`
echo "$appointed_scale_factor" > $CONTAINER_PATH/scale.txt
wine_scale=`cat $CONTAINER_PATH/scale.txt`
fi
@@ -91,7 +105,7 @@ fi
if [ "$APPRUN_CMD" = "" ];then
echo "没有检测到APPRUN_CMD环境变量执行sed替换。如果要使用wine原生提供的方法请在环境变量中指定(export)"
case "$env_dwine_scale" in
case "$wine_scale" in
1.0)
reg_text="\"LogPixels\"=dword:00000060"
;;
@@ -101,6 +115,9 @@ case "$env_dwine_scale" in
1.5)
reg_text="\"LogPixels\"=dword:00000090"
;;
1.75)
reg_text="\"LogPixels\"=dword:000000A8"
;;
2.0)
reg_text="\"LogPixels\"=dword:000000C0"
;;
@@ -132,7 +149,7 @@ echo "---------------------------------------"
else
#####用wine提供的方法
case "$env_dwine_scale" in
case "$wine_scale" in
1.0)
dpi="96"
;;
@@ -142,6 +159,9 @@ case "$env_dwine_scale" in
1.5)
dpi="144"
;;
1.75)
dpi="168"
;;
2.0)
dpi="192"
;;

View File

@@ -1,8 +1,5 @@
#/bin/bash
mkdir -p ~/.config/spark-wine/
#########>>>>>>>函数段
Get_Dist_Name()
{
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
@@ -13,40 +10,59 @@ Get_Dist_Name()
DISTRO='OtherOS'
fi
}
#########<<<<<<<
if [ $# -lt 1 ]; then
echo "无参数无法启动。请参考set-dwine-scale.sh使用"
echo "参数为CONTAINER_PATH"
echo "只读取第一个,其他参数会被放弃"
fi
CONTAINER_PATH="$1"
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 "检测到已经设置过全局参数,直接复制"
exit
fi
Get_Dist_Name
if [ "$DISTRO" = "Deepin" ] || [ "$DISTRO" = "UniontechOS" ];then
echo 1.0 > ~/.config/spark-wine/scale.txt
echo 1.0 > $HOME/.config/spark-wine/scale.txt
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
#####就是1倍缩放
exit
fi
real_path_of_the_fucking_scale_txt=`echo ~/.config/spark-wine/scale.txt`
if [ -f "$real_path_of_the_fucking_scale_txt" ];then
echo "设置过了,直接读"
unset real_path_of_the_fucking_scale_txt
exit
fi
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
scale_factor=`zenity --list \
--width=700 \
--height=300 \
--height=350 \
--title="您的分辨率是:$dimensions,请在以下选项中选择一个以运行应用" \
--column="缩放倍率" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0`
case "$scale_factor" in
"")
zenity --info --text="默认为1倍缩放。您可以随时删除~/.config/spark-wine/scale.txt来重新设置"
zenity --info --text="默认为1倍缩放。您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="缩放倍数为$scale_factor。已保存!您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150
;;
esac
echo "$scale_factor" > ~/.config/spark-wine/scale.txt
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt

View File

@@ -14,6 +14,21 @@
#
#
#######################函数段。下文调用的额外功能会在此处声明
Get_Dist_Name()
{
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
DISTRO='Deepin'
elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
####获得发行版名称
#########################预设值段
version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
@@ -79,17 +94,3 @@ else
fi
#######################函数段。上文调用的额外功能会在此处声明
Get_Dist_Name()
{
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
DISTRO='Deepin'
elif grep -Eqi "Uniontech" /etc/issue || grep -Eq "Uniontech" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
####获得发行版名称