mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2026-05-14 02:00:18 +08:00
现在支持图形化设置缩放
This commit is contained in:
@@ -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 |
Reference in New Issue
Block a user