add: scale support

This commit is contained in:
2025-02-26 02:07:16 +08:00
parent f4a3b9ec7f
commit a67cf6b6c9
2 changed files with 6 additions and 62 deletions

View File

@@ -48,14 +48,6 @@ parse_args() {
################ ################
parse_args "$@" parse_args "$@"
#####先看看PATH对不对
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
echo "错误找不到user.reg退出。你应当在文件解压结束后调用此脚本。"
echo "如果你不清楚如何使用这个脚本,请使用 $0 -h"
echo "E: Can not find user.reg. Exit. You should use this script after the extraction"
echo "If you don't know how to use this script, try $0 -h"
exit 1
fi
if [ "$appointed_scale_factor" = "" ];then if [ "$appointed_scale_factor" = "" ];then
@@ -111,59 +103,8 @@ fi
########如果环境变量里没指定了APPRUN_CMD在run.sh中就替换如果有就直接用来设置 ########如果环境变量里没指定了APPRUN_CMD在run.sh中就替换如果有就直接用来设置
if [ "$APPRUN_CMD" = "" ];then if [ "$APPRUN_CMD" = "" ];then
echo "没有检测到APPRUN_CMD环境变量执行sed替换。如果要使用wine原生提供的方法请在环境变量中指定(export)" echo "没有检测到APPRUN_CMD环境变量请在环境变量中指定(export),本脚本退出"
case "$wine_scale" in exit 1
1.0*)
reg_text="\"LogPixels\"=dword:00000060"
;;
1.25*)
reg_text="\"LogPixels\"=dword:00000078"
;;
1.5*)
reg_text="\"LogPixels\"=dword:00000090"
;;
1.75*)
reg_text="\"LogPixels\"=dword:000000A8"
;;
2.0*)
reg_text="\"LogPixels\"=dword:000000C0"
;;
2.5*)
reg_text="\"LogPixels\"=dword:000000F0"
;;
3.0*)
reg_text="\"LogPixels\"=dword:00000120"
;;
3.5*)
reg_text="\"LogPixels\"=dword:00000150"
;;
4.0*)
reg_text="\"LogPixels\"=dword:00000180"
;;
*)
reg_text="\"LogPixels\"=dword:00000060"
#可能不是Xorg
;;
esac
#####根据scale设置dword值
LogPixels_line=(`sed -n -e "/"LogPixels"/=" $CONTAINER_PATH/user.reg`)
#####关键词行数取得
until [ "${#LogPixels_line[@]}" = "0" ];do
line_num=${LogPixels_line[0]}
sed -i "$line_num"c\ "$reg_text" "$CONTAINER_PATH/user.reg"
LogPixels_line=(${LogPixels_line[@]:1})
done
echo "已经完成替换。位置:$CONTAINER_PATH/user.reg"
echo "在以下行数进行了替换,内容为$reg_text"
echo `sed -n -e "/"LogPixels"/=" $CONTAINER_PATH/user.reg`
echo "---------------------------------------"
else else
#####用wine提供的方法 #####用wine提供的方法

View File

@@ -45,4 +45,7 @@ fi
# Run spark-wine with WINEPREFIX # Run spark-wine with WINEPREFIX
export WINEPREFIX="$HOME/.wine" export WINEPREFIX="$HOME/.wine"
spark-wine "$@" export APPRUN_CMD="spark-wine"
/opt/spark-dwine-helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh ${WINEPREFIX}
${APPRUN_CMD} "$@"