现在支持图形化设置缩放

This commit is contained in:
2022-06-19 21:57:10 +08:00
parent 3e36c11e88
commit e893040b98
7 changed files with 155 additions and 10 deletions

View File

@@ -12,11 +12,10 @@ exit 1
fi fi
version="$1" version="$1"
######################################################
echo "build debian package" echo "build debian package"
mkdir -p pkg/DEBIAN mkdir -p pkg/DEBIAN
cp -r ./s-wine-helper pkg/opt cp -r ./s-wine-helper pkg/opt
SIZE=`du -s ./pkg` SIZE=`du -s ./pkg`
SIZE=`echo ${SIZE%%.*}` SIZE=`echo ${SIZE%%.*}`
@@ -29,8 +28,9 @@ Installed-Size: $SIZE
Depends: zenity:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1) Depends: zenity:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1)
Section: utils Section: utils
Priority: extra Priority: extra
Recommends: spark-dwine-helper-settings
Multi-Arch: foreign Multi-Arch: foreign
Replaces: store.spark-app.spark-dwine-helper(<<$version) Replaces: store.spark-app.spark-dwine-helper(<=$version)
Homepage: https://gitee.com/deepin-community-store/spark-wine Homepage: https://gitee.com/deepin-community-store/spark-wine
Description: Spark Deepin Wine Helper Description: Spark Deepin Wine Helper
@@ -42,7 +42,7 @@ cd ..
echo "普通deb包已经准备好正在生成UOS deb包" echo "普通deb包已经准备好正在生成UOS deb包"
rm -rf pkg/ rm -rf pkg/
######################################### #################################################################
mkdir -p pkg/DEBIAN mkdir -p pkg/DEBIAN
cp -r package-source/uos-assets/opt pkg/ cp -r package-source/uos-assets/opt pkg/
cp -r s-wine-helper/* pkg/opt cp -r s-wine-helper/* pkg/opt
@@ -82,9 +82,10 @@ Installed-Size: $SIZE
Depends: zenity:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1) Depends: zenity:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1)
Section: utils Section: utils
Priority: extra Priority: extra
Recommends: spark-dwine-helper-settings
Provides: spark-dwine-helper(=$version) Provides: spark-dwine-helper(=$version)
Conflicts: spark-dwine-helper Conflicts: spark-dwine-helper
Replaces: spark-dwine-helper(<<$version) Replaces: spark-dwine-helper(<=$version)
Multi-Arch: foreign Multi-Arch: foreign
Homepage: https://gitee.com/deepin-community-store/spark-wine Homepage: https://gitee.com/deepin-community-store/spark-wine
Description: Spark Deepin Wine Helper Description: Spark Deepin Wine Helper
@@ -97,3 +98,31 @@ cd ..
echo "UOS deb包已经准备好" echo "UOS deb包已经准备好"
rm -rf pkg/ rm -rf pkg/
########################################
mkdir -p pkg/DEBIAN
cp -r package-source/spark-dwine-helper-settings/* pkg/
SIZE=`du -s ./pkg`
SIZE=`echo ${SIZE%%.*}`
cat << EOF >pkg/DEBIAN/control
Package: spark-dwine-helper-settings
Version: 1.0
Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: $SIZE
Depends: spark-dwine-helper(>=1.6)
Section: utils
Priority: extra
Multi-Arch: foreign
Homepage: https://gitee.com/deepin-community-store/spark-wine
Description: Spark Deepin Wine Helper
EOF
cd pkg && fakeroot dpkg-deb -Z xz -b . ../
cd ..
echo "helper deb包已经准备好"
rm -rf pkg/

View File

@@ -0,0 +1,102 @@
#/bin/bash
until [ "$IS_CLOSE" = "1" ];do
CHOSEN_SETTINGS=`zenity --list \
--width=700 \
--height=350 \
--title="欢迎使用星火wine助手控制中心请在以下选项中选择一个执行" \
--column="操作" \
设置全局缩放 \
设置单独应用缩放 \
以上操作仅对使用了spark-dwine-helper的应用生效 `
echo "$CHOSEN_SETTINGS"
case "$CHOSEN_SETTINGS" in
"设置全局缩放")
########
zenity --info --text="请注意此选项对deepin/UOS无效会优先读取deepin/UOS的缩放设置进行缩放" --width=500 --height=150
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
scale_factor=`zenity --list \
--width=700 \
--height=350 \
--title="您的分辨率是:$dimensions,请在以下选项中选择一个" \
--column="缩放倍率" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0`
case "$scale_factor" in
"")
zenity --info --text="默认为1倍缩放。" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="缩放倍数为$scale_factor。已保存!" --width=500 --height=150
;;
esac
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
;;
########
"设置单独应用缩放")
zenity --info --text="请在接下来的文件选择框选中所需的应用所在的容器文件夹(注意要选择文件夹)" --width=500 --height=150
CONTAINER_PATH=`zenity --file-selection --filename="/home/shenmo/.deepinwine/" --directory`
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
zenity --info --text="错误找不到user.reg.这不是一个wine容器" --width=500 --height=150
else
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
scale_factor=`zenity --list \
--width=700 \
--height=350 \
--title="您的分辨率是:$dimensions,请在以下选项中选择一个" \
--column="缩放倍率" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0 \
与全局设置同步 `
case "$scale_factor" in
"")
zenity --info --text="默认为1倍缩放。" --width=500 --height=150
scale_factor="1.0"
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s $scale_factor $CONTAINER_PATH
;;
"与全局设置同步")
zenity --info --text="将会与全局设置同步" --width=500 --height=150
rm $CONTAINER_PATH/scale.txt
;;
*)
zenity --info --text="缩放倍数为$scale_factor。已保存!" --width=500 --height=150
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s $scale_factor $CONTAINER_PATH
;;
esac
fi
;;
"以上操作仅对使用了spark-dwine-helper的应用生效")
;;
*)
IS_CLOSE="1"
;;
esac
done

View File

@@ -0,0 +1,13 @@
[Desktop Entry]
Categories=Utility;
Encoding=UTF-8
Exec=sh -c "/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"
Icon=spark-dwine-helper-settings
MimeType=
Name=Spark Wine Helper Settings
Name[zh_CN]=星火wine助手设置
StartupWMClass=spark-dwine-helper-settings
Terminal=False
Type=Application
NoDisplay=false
X-Deepin-Vendor=user-custom

View File

@@ -1,11 +1,12 @@
[Desktop Entry] [Desktop Entry]
Categories=Utility; Categories=Utility;
Encoding=UTF-8 Encoding=UTF-8
Exec=zenity --info --text="请前往 /opt/durapps/spark-dwine-helper/ 查看" --width=500 --height=150 Exec=sh -c "/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"
Icon=store.spark-app.spark-dwine-helper Icon=store.spark-app.spark-dwine-helper
MimeType= MimeType=
Name=store.spark-app.spark-dwine-helper Name=Spark Wine Helper Settings
StartupWMClass=spark-webapp-runtime Name[zh_CN]=星火wine助手设置
StartupWMClass=spark-dwine-helper-settings
Terminal=False Terminal=False
Type=Application Type=Application
NoDisplay=true NoDisplay=true

View File

@@ -65,11 +65,11 @@ scale_factor=`zenity --list \
case "$scale_factor" in case "$scale_factor" in
"") "")
zenity --info --text="默认为1倍缩放。您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150 zenity --info --text="默认为1倍缩放。您可以使用星火wine助手设置来重新设置" --width=500 --height=150
scale_factor="1.0" scale_factor="1.0"
;; ;;
*) *)
zenity --info --text="缩放倍数为$scale_factor。已保存!您可以随时删除~/.config/spark-wine/scale.txt来重新设置" --width=500 --height=150 zenity --info --text="缩放倍数为$scale_factor。已保存!您可以使用星火wine助手设置来重新设置" --width=500 --height=150
;; ;;
esac esac
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt