mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2025-12-19 05:21:40 +08:00
现在支持图形化设置缩放
This commit is contained in:
@@ -12,11 +12,10 @@ exit 1
|
||||
fi
|
||||
|
||||
version="$1"
|
||||
|
||||
######################################################
|
||||
echo "build debian package"
|
||||
mkdir -p pkg/DEBIAN
|
||||
cp -r ./s-wine-helper pkg/opt
|
||||
|
||||
SIZE=`du -s ./pkg`
|
||||
SIZE=`echo ${SIZE%%.*}`
|
||||
|
||||
@@ -29,8 +28,9 @@ Installed-Size: $SIZE
|
||||
Depends: zenity:amd64, p7zip-full:amd64, fonts-noto-cjk,deepin-wine-helper(>=5.1)
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Recommends: spark-dwine-helper-settings
|
||||
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
|
||||
Description: Spark Deepin Wine Helper
|
||||
|
||||
@@ -42,7 +42,7 @@ cd ..
|
||||
|
||||
echo "普通deb包已经准备好,正在生成UOS deb包"
|
||||
rm -rf pkg/
|
||||
#########################################
|
||||
#################################################################
|
||||
mkdir -p pkg/DEBIAN
|
||||
cp -r package-source/uos-assets/opt pkg/
|
||||
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)
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Recommends: spark-dwine-helper-settings
|
||||
Provides: spark-dwine-helper(=$version)
|
||||
Conflicts: spark-dwine-helper
|
||||
Replaces: spark-dwine-helper(<<$version)
|
||||
Replaces: spark-dwine-helper(<=$version)
|
||||
Multi-Arch: foreign
|
||||
Homepage: https://gitee.com/deepin-community-store/spark-wine
|
||||
Description: Spark Deepin Wine Helper
|
||||
@@ -97,3 +98,31 @@ cd ..
|
||||
|
||||
echo "UOS deb包已经准备好"
|
||||
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/
|
||||
@@ -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
|
||||
@@ -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
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
@@ -1,11 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;
|
||||
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
|
||||
MimeType=
|
||||
Name=store.spark-app.spark-dwine-helper
|
||||
StartupWMClass=spark-webapp-runtime
|
||||
Name=Spark Wine Helper Settings
|
||||
Name[zh_CN]=星火wine助手设置
|
||||
StartupWMClass=spark-dwine-helper-settings
|
||||
Terminal=False
|
||||
Type=Application
|
||||
NoDisplay=true
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 47 KiB |
@@ -65,11 +65,11 @@ scale_factor=`zenity --list \
|
||||
|
||||
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"
|
||||
;;
|
||||
*)
|
||||
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
|
||||
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
|
||||
|
||||
Reference in New Issue
Block a user