Compare commits

...

66 Commits

Author SHA1 Message Date
6f4725118b !22 更新 Spark Wine 启动器图标
Merge pull request !22 from MeowVing/master
2025-06-23 16:02:58 +00:00
7460dc7f1d 更新图标
Signed-off-by: MeowVing <meowving@foxmail.com>
2025-06-21 10:01:54 +00:00
0fd138fee1 删除文件 spark-dwine-helper/s-wine-helper/usr/share/icons/hicolor/scalable/apps/spark-dwine-helper.png 2025-06-21 10:01:23 +00:00
4d7dbc82cc 不再启动 spark-wine-banner
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-06-14 09:16:11 +00:00
8a905f9908 remove hijack 2025-04-15 23:50:47 +08:00
83a04c88ef update 打包用例/pre_update.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-04-12 10:49:44 +00:00
6c1771c869 可执行权限 2025-03-06 19:34:42 +08:00
ada388d347 update
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-03-03 15:25:45 +00:00
935c27d04c fix spark-wine9 2025-03-03 21:46:58 +08:00
2d7a7b0c00 not wine9 2025-03-03 13:17:02 +08:00
bfb3ed8b87 fix display 2025-03-03 13:12:00 +08:00
84002bd9d5 panel 2025-03-03 13:06:49 +08:00
e57bc6e1ae 其他的wine desktop也删 2025-02-27 23:21:36 +08:00
93410c090d finished wrapper 2025-02-27 23:19:51 +08:00
bff5b2848f update: 修复启动失败 2025-02-26 21:44:57 +08:00
8fc7dc9435 支持检测更多的环境变量 2025-02-26 11:41:15 +08:00
dfcecf30db 优化设置缩放逻辑 2025-02-26 11:34:08 +08:00
3b19f5f26c 精简代码 2025-02-26 11:15:22 +08:00
d584b6757b update:正确启动设置缩放 2025-02-26 10:47:20 +08:00
a67cf6b6c9 add: scale support 2025-02-26 02:07:16 +08:00
f4a3b9ec7f ready for mimetype 2025-02-26 01:53:50 +08:00
6c59b8378a add: wine launcher 2025-02-26 01:51:28 +08:00
34eb09779e init: Wine启动器 2025-02-25 23:21:58 +08:00
3481696e75 fix: Can't read bottle name 2025-01-02 22:43:46 +08:00
36c912e762 不再又臭又长 2025-01-02 22:33:17 +08:00
a5893503ed update fallback appname
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-01-01 07:10:41 +00:00
d3353b0033 update 打包用例/run.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-12-17 06:00:53 +00:00
73f28e7c1f update 打包用例/run.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-11-07 07:14:18 +00:00
6407bf0720 fix: 部分Wine应用调整缩放后无法使用 2024-11-04 23:35:43 +08:00
61faeee4fc adjust doc 2024-11-04 23:28:52 +08:00
29629d4dd1 change description 2024-11-04 23:27:35 +08:00
7fc796b0b2 屏蔽无用入口 2024-11-04 23:23:15 +08:00
7402323bb5 remove usr files 2024-11-04 23:16:03 +08:00
6218d5f12d 合并settings的代码,改善用法 2024-11-04 23:11:02 +08:00
248dab68b6 fix: --disable-gpu等参数无法正确传递
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-11-02 16:29:51 +00:00
449e84775f update 打包用例/run.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-08-30 05:14:42 +00:00
7d19e765cb Support GXDE deepin-box64
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-08-30 05:14:02 +00:00
c7b766c4e7 修复:支持带空格的应用
修复:启动失败
2024-08-09 23:59:06 +08:00
7975c46cd4 Use bash instead of sh
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-08-06 07:56:02 +00:00
8d334aebf8 Stop the annoying banner
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-08-06 07:26:42 +00:00
51d0936e2e !20 打包用例加入 Wine 自解压支持
Merge pull request !20 from gfdgd xi/master
2024-08-03 01:28:59 +00:00
ac3caf46ac 打包用例加入wine自解压支持 2024-08-03 08:06:38 +08:00
03704b2692 !19 调整helper部分绝对路径为相对路径
Merge pull request !19 from gfdgd xi/master
2024-08-02 14:54:54 +00:00
222b5f10a6 修复一些兼容性问题 2024-07-30 12:44:25 +08:00
cd2e804407 修改打包用例 2024-07-16 22:34:54 +08:00
cd1d78b64c runtime-i386的优先级选择 2024-07-16 22:13:13 +08:00
0a203effd1 漏改了个 2024-07-16 22:10:47 +08:00
9cfa2f8327 使用关键词识别spark_run_v4.sh 2024-07-16 22:09:14 +08:00
08d12d068e 将部分绝对路径改为相对路径以方便集成 2024-07-16 14:23:37 +08:00
41e3b3265b fix:Can not switch scale for single app 2024-07-14 16:21:05 +08:00
7f6d469b22 add-high-dpi 2024-07-14 16:07:37 +08:00
42ddcb2db3 feat: Auto switch wine helper to reduce package maintaining pressure
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-28 08:05:56 +00:00
402e571d8d update 打包用例/pre_update.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-25 14:02:01 +00:00
7526b84fe6 update 打包用例/postrm.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-05-21 15:13:50 +00:00
9be1a7a739 usr 2024-05-08 13:04:05 +08:00
719ec216f2 修复拉屎 2024-05-08 12:29:30 +08:00
00598891ff 不再往系统拉屎 2024-05-08 11:59:35 +08:00
b82aac8f6f update spark-dwine-helper/s-wine-helper/opt/deepinwine/tools/spark_run_v4.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-05-07 03:11:23 +00:00
65d88b222f 添加功能 2024-05-06 10:48:24 +08:00
1af2d8e446 add:clean bottle 2024-05-06 10:41:38 +08:00
5898087510 更新banner 2024-05-06 10:36:52 +08:00
4e54c62c47 Merge remote-tracking branch 'refs/remotes/origin/master' 2024-05-06 09:59:18 +08:00
a23503e298 修改: spark-dwine-helper/s-wine-helper/opt/deepinwine/tools/spark-wine-banner 2024-05-06 09:59:14 +08:00
0705e9c9ab add-banner 2024-05-06 09:33:32 +08:00
933497abcf update spark-dwine-helper/s-wine-helper/opt/deepinwine/tools/spark-wine-banner.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-05-01 19:13:20 +00:00
c0c0ce9a72 fix-app-start 2024-05-02 02:56:41 +08:00
84 changed files with 804 additions and 372 deletions

View File

@@ -26,6 +26,7 @@ Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: $SIZE
Depends: zenity, p7zip-legacy (>= 16.02+dfsg-8+Mejituu-2024022216) | p7zip-full (<< 16.02+transitional.1), fonts-noto-cjk, transhell, python3, wmctrl
Recommends: python3-pyqt5
Section: utils
Priority: extra
Multi-Arch: foreign
@@ -37,11 +38,12 @@ Description: Spark Deepin Wine Helper
EOF
cp postrm pkg/DEBIAN/postrm
cp postinst pkg/DEBIAN/postinst
cp prerm pkg/DEBIAN/prerm
chmod +x pkg/DEBIAN/postrm
chmod +x pkg/DEBIAN/postinst
chmod +x pkg/DEBIAN/prerm
cd pkg && fakeroot dpkg-deb -Z xz -b . ../
cd ..
@@ -55,7 +57,7 @@ cat << EOF >pkg/opt/apps/store.spark-app.spark-dwine-helper/info
"appid": "store.spark-app.spark-dwine-helper",
"name": "store.spark-app.spark-dwine-helper",
"version": "$version",
"arch": ["amd64,arm64,mipsel64,sw64"],
"arch": ["amd64,arm64"],
"permissions": {
"autostart": false,
"notification": false,
@@ -83,7 +85,7 @@ Architecture: all
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: $SIZE
Depends: zenity, p7zip-legacy (>= 16.02+dfsg-8+Mejituu-2024022216) | p7zip-full (<< 16.02+transitional.1), fonts-noto-cjk, transhell, python3
Recommends: wmctrl
Recommends: wmctrl,python3-pyqt5
Section: utils
Priority: extra
Provides: spark-dwine-helper(=$version)

View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [ ! -d /opt/deepinwine/tools ];then
mkdir -p /opt/deepinwine/tools
fi
ln -svf /opt/spark-dwine-helper/spark_run_v4.sh /opt/deepinwine/tools/spark_run_v4.sh
ln -svf /opt/spark-dwine-helper/spark_kill.sh /opt/deepinwine/tools/spark_kill.sh

View File

@@ -1,15 +0,0 @@
#!/bin/bash
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
echo "清理卸载残留"
for username in $(ls /home)
do
echo /home/$username
if [ -d /home/$username/.config/spark-wine ]
then
rm -rf /home/$username/.config/spark-wine
fi
done
else
echo "非卸载,跳过清理"
fi

5
spark-dwine-helper/prerm Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
unlink /opt/deepinwine/tools/spark_run_v4.sh
unlink /opt/deepinwine/tools/spark_kill.sh

View File

@@ -1,13 +0,0 @@
[Desktop Entry]
Categories=Utility;
Encoding=UTF-8
Exec=bash -c "/opt/durapps/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh"
Icon=store.spark-app.spark-dwine-helper
MimeType=
Name=Spark Wine App Launcher
Name[zh_CN]=星火Wine应用启动器
StartupWMClass=spark-dwine-helper-settings
Terminal=False
Type=Application
NoDisplay=false
X-Deepin-Vendor=user-custom

View File

@@ -1,39 +0,0 @@
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }

View File

@@ -1,36 +0,0 @@
#!/bin/bash
source $(dirname $0)/log-function.bashimport
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'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
Get_Dist_Name
## 1. If WINEPREFIX is not set, use ~/.wine
if [ "$WINEPREFIX" = "" ];then
export WINEPREFIX=$HOME/.wine
fi
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ];then
log.warn "WARNING:USING BOX64 INSTEAD OF DEEPIN-BOX64,SOME APP MAY FAIL TO LAUNCH"
spark-box64 /opt/deepin-wine8-stable/bin/wine "$@"
else
deepin-wine8-stable "$@"
fi

View File

@@ -1,39 +0,0 @@
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }

View File

@@ -1,82 +0,0 @@
#/bin/bash
source /opt/durapps/transhell/transhell.sh
load_transhell_debug
#########>>>>>>>函数段
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'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
#########<<<<<<<
if [ $# -lt 1 ]; then
echo "无参数无法启动。这是一个set-wine-scale的组件一般来说你不会需要单独启动这个脚本"
echo "请参考set-wine-scale.sh使用"
echo "参数为CONTAINER_PATH"
echo "只读取第一个,其他参数会被放弃"
fi
CONTAINER_PATH="$1"
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
echo "错误找不到user.reg退出。你应当在文件解压结束后调用此脚本"
echo "E: Can not find user.reg. Exit. You should use this script after the extraction"
exit 1
fi
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 "检测到已经设置过全局参数,直接复制"
echo "全局参数的位置在$HOME/.config/spark-wine/scale.txt如果需要更换请删除此文件重新生成"
exit
fi
Get_Dist_Name
if [ "$DISTRO" = "UniontechOS" ];then
echo 1.0 > $HOME/.config/spark-wine/scale.txt
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
#####就是1倍缩放
exit
fi
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
scale_factor=`zenity --list \
--width=700 \
--height=350 \
--title="${TRANSHELL_CONTENT_YOUR_DIMENSION_IS} $dimensions ${TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW}" \
--column="${TRANSHELL_CONTENT_OPTION}" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0`
case "$scale_factor" in
"")
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
;;
esac
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt

View File

@@ -0,0 +1,5 @@
#!/bin/bash
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }

View File

@@ -0,0 +1,32 @@
#!/bin/bash
##load transhell
function load_transhell_debug()
{
local WORK_PATH="$(dirname $(realpath $0))"
echo $WORK_PATH
local CURRENT_LANG="$(echo ${LANG%.*})"
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi
echo "-----------------------------------------------------------------------------"
}
function load_transhell()
{
local WORK_PATH="$(dirname $(realpath $0))"
local CURRENT_LANG="$(echo ${LANG%.*})"
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi
}
function update_transhell()
{
load_transhell $@
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

View File

@@ -0,0 +1,127 @@
#!/usr/bin/env python3
import os
import sys
import time
import subprocess
import threading
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
def check_window():
# 使用 wmctrl 命令列出所有窗口,并使用 grep 过滤出特定的 WMCLASS
windows = subprocess.getoutput(f'wmctrl -lx | grep "{target_wmclass}"')
# 如果窗口存在,则关闭提示
if windows.replace("\n", "").replace(" ", "") != "":
# 提取窗口ID
window_id = windows.replace(" ", " ").split(" ")[0]
print(f"Window with WMCLASS '{target_wmclass}' found")
return 1
# else:
# print(f"Window with WMCLASS '{target_wmclass}' not found.")
def check_wmclass():
if timeout:
time.sleep(timeout)
window.close()
return
# 循环检测窗口是否存在的函数
# 每隔一段时间检测一次窗口是否存在
showtimeout = 20 # 为防止因为应用无法打开而无法正常关闭窗口,于是设置 time out
while True:
if check_window():
break
# 等待一段时间后再次检测
time.sleep(1)
AppInfoShowerRefresh()
showtimeout -= 1
if showtimeout <= 0:
break
window.close()
timeout = 0
if os.getenv("WAYLAND_DISPLAY"):
timeout = 3
if os.system("which wmctrl"):
print("No wmctrl installed. Do not check wmclass")
timeout = 3
target_wmclass = os.getenv("WINE_WMCLASS")
def GetRecommendWindowSize(window: QMainWindow):
# 计算屏幕分辨率
screen = QGuiApplication.primaryScreen()
width = screen.geometry().width()
height = screen.geometry().height()
# 如果为竖状屏幕
if width < height:
temp = height
height = width
width = temp
return [int(width / 4), window.geometry().height()]
def SetWindowSize(window: QMainWindow):
# 计算比例
size = GetRecommendWindowSize(window)
window.resize(size[0], size[1])
def MoveCenter(window: QMainWindow):
# 计算屏幕分辨率
screen = QGuiApplication.primaryScreen()
width = screen.geometry().width()
height = screen.geometry().height()
print(window.geometry().height())
# 计算窗口坐标
window.move(int(width / 2 - window.geometry().width() / 2),
int(height / 2.8 - window.geometry().height() / 2)
)
def AppInfoShowerRefresh():
global appInfoShowerTime
appInfoShower.setText(f"<h3 align='center'>星火Windows应用兼容助手</h3><p align='center'>正在为您启动以下应用:{os.getenv('WINE_APP_NAME')} {'.' * (appInfoShowerTime % 3 + 1)}</p>")
appInfoShowerTime += 1
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
app = QApplication(sys.argv)
# 构建窗口
window = QMainWindow()
widget = QWidget()
layout = QGridLayout()
appInfoShower = QLabel()
appInfoShowerTime = 0
AppInfoShowerRefresh()
# GXDE 彩蛋
if os.path.exists("/usr/share/gxde-resources/spark-dwine-helper.png"):
backgroundImgPath = "/usr/share/gxde-resources/spark-dwine-helper.png"
##########
if os.path.exists(f"{programPath}/fallback.png"):
backgroundImgPath = f"{programPath}/fallback.png"
if os.path.exists(f"/opt/apps/{os.getenv('DEB_PACKAGE_NAME')}/files/banner.png"):
backgroundImgPath = f"/opt/apps/{os.getenv('DEB_PACKAGE_NAME')}/files/banner.png"
window.setWindowTitle("星火Windows应用兼容助手")
layout.addWidget(QLabel(f""), 1, 0)
layout.addWidget(appInfoShower, 2, 0)
layout.addWidget(QLabel(f"<hr>由 Wine 运行器提供支持"), 4, 0)
widget.setLayout(layout)
window.setCentralWidget(widget)
window.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowStaysOnTopHint)
MoveCenter(window)
SetWindowSize(window)
window.show()
layout.addWidget(QLabel(f"<p align='center'><img width='{window.geometry().width()}' src='{backgroundImgPath}'></p>"), 0, 0)
threading.Thread(target=check_wmclass).start()
MoveCenter(window)
app.exec_()

View File

@@ -0,0 +1,107 @@
#!/bin/bash
# 导入 transhell.bashimport 脚本并加载调试模式
source ${SHELL_DIR}/bashimport/transhell.bashimport
load_transhell_debug
#########>>>>>>> 函数段
# 获取当前系统的发行版名称
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'
elif grep -Eqi "GXDE" /etc/issue || grep -Eq "GXDE" /etc/*-release; then
DISTRO='GXDE'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
# 检测常见的缩放环境变量
Check_Scale_Env_Vars()
{
if [ -n "$DEEPIN_WINE_SCALE" ]; then
echo "$DEEPIN_WINE_SCALE"
return 0
elif [ -n "$GDK_SCALE" ]; then
echo "$GDK_SCALE"
return 0
elif [ -n "$QT_SCALE_FACTOR" ]; then
echo "$QT_SCALE_FACTOR"
return 0
elif [ -n "$WINIT_X11_SCALE_FACTOR" ]; then
echo "$WINIT_X11_SCALE_FACTOR"
return 0
elif [ -n "$ELM_SCALE" ]; then
echo "$ELM_SCALE"
return 0
fi
return 1
}
######<<<<<<<
# 提示全局参数的位置
echo "全局参数的位置在 $HOME/.config/spark-wine/scale.txt"
# 创建配置目录
mkdir -p $HOME/.config/spark-wine/
# 检查是否已经设置过全局参数
if [ -f "$HOME/.config/spark-wine/scale.txt" ]; then
echo "已经设置过全局参数,使用"
echo "全局参数的位置在 $HOME/.config/spark-wine/scale.txt如果需要更换请删除此文件重新生成"
exit
fi
# 检测常见的缩放环境变量
scale_value=$(Check_Scale_Env_Vars)
if [ -n "$scale_value" ]; then
echo "$scale_value" > $HOME/.config/spark-wine/scale.txt
echo "检测到缩放环境变量,使用 $scale_value 作为缩放比例"
exit
fi
# 如果环境变量未设置,则根据系统发行版设置默认缩放比例
Get_Dist_Name
if [ "$DISTRO" = "UniontechOS" ] || [ "$DISTRO" = "GXDE" ]; then
echo "1.0" > $HOME/.config/spark-wine/scale.txt
echo "检测到 UniontechOS 或 GXDE 系统,使用 1.0 作为默认缩放比例"
exit
fi
# 获取当前显示器的分辨率
dimensions=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')
# 使用 Zenity 弹窗让用户选择缩放比例
scale_factor=$(zenity --list \
--width=700 \
--height=350 \
--title="${TRANSHELL_CONTENT_YOUR_DIMENSION_IS} $dimensions ${TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW}" \
--column="${TRANSHELL_CONTENT_OPTION}" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0 \
2.5 \
3.0 \
3.5 \
4.0)
# 处理用户的选择
case "$scale_factor" in
"")
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
;;
esac
# 将用户选择的缩放比例保存到配置文件中
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt

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.51.752.0
-s|--set-scale-factor 直接指定缩放。支持1.01.251.51.752.0,2.5,3.0,3.5,4.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.51.752.0
-s|--set-scale-factor Set scale factor direcly. Support 1.01.251.51.752.0,2.5,3.0,3.5,4.0
path Wine Container directory path
This script have super bunny power.
@@ -32,7 +32,7 @@ parse_args() {
;;
"bunny")
cat /opt/durapps/spark-dwine-helper/scale-set-helper/bunny.txt
cat ${SHELL_DIR}/spark-dwine-helper/scale-set-helper/bunny.txt
exit
;;
@@ -48,36 +48,17 @@ 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
#########未指定下,读取$CONTAINER_PATH/scale.txt。如果没有优先$DEEPIN_WINE_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 get-scale.sh to Set "
echo "错误没有检测到DEEPIN_WINE_SCALE用get-scale.sh设置"
/opt/durapps/spark-dwine-helper/scale-set-helper/get-scale.sh "$CONTAINER_PATH"
wine_scale=`cat $CONTAINER_PATH/scale.txt`
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/get-scale.sh
wine_scale=$(cat $HOME/.config/spark-wine/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`
@@ -96,7 +77,7 @@ echo "使用了--set-scale-factor直接指定"
echo "--set-scale-factor detected. Arrange directly"
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
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" ] && [ "$appointed_scale_factor" != "2.5" ] && [ "$appointed_scale_factor" != "3.0" ] && [ "$appointed_scale_factor" != "3.5" ] && [ "$appointed_scale_factor" != "4.0" ];then
echo "无法识别的倍数:$appointed_scale_factor,请参看$0 -h"
echo "Unrecognizable number. Use $0 -h to get help"
exit 1
@@ -111,47 +92,8 @@ fi
########如果环境变量里没指定了APPRUN_CMD在run.sh中就替换如果有就直接用来设置
if [ "$APPRUN_CMD" = "" ];then
echo "没有检测到APPRUN_CMD环境变量执行sed替换。如果要使用wine原生提供的方法请在环境变量中指定(export)"
case "$wine_scale" in
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"
;;
*)
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 "---------------------------------------"
echo "没有检测到APPRUN_CMD环境变量请在环境变量中指定(export),本脚本退出"
exit 1
else
#####用wine提供的方法
@@ -172,6 +114,18 @@ case "$wine_scale" in
2.0*)
dpi="192"
;;
2.5*)
dpi="240"
;;
3.0*)
dpi="288"
;;
3.5*)
dpi="336"
;;
4.0*)
dpi="384"
;;
*)
dpi="96"
#可能不是Xorg或者是其他错误

View File

@@ -0,0 +1,42 @@
#!/bin/bash
# 定义日志函数
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
desktop_dir="${HOME}/.local/share/applications/wine/Programs"
find "$desktop_dir" -type f -name "*.desktop" | while read -r desktop_file; do
log.debug "处理文件: $desktop_file"
exec_line=$(grep -i '^Exec=' "$desktop_file" | cut -d'=' -f2- | xargs)
wineprefix=$(echo "$exec_line" | grep -o 'WINEPREFIX=[^ ]*' | cut -d'=' -f2)
# 核心修复使用正则表达式提取完整Windows路径
exe_win_path=$(echo "$exec_line" | grep -o 'C:\\\\.*\.lnk' | head -1)
log.debug "WINEPREFIX: '$wineprefix'"
log.debug "原始 Windows 路径: '$exe_win_path'"
if [[ -z "$wineprefix" || -z "$exe_win_path" ]]; then
log.warn "参数不完整,跳过"
continue
fi
# 路径转换:处理转义字符和路径分隔符
exe_win_path_unix=$(printf "%b" "$exe_win_path" | sed -e 's/\\/\//g' -e 's/^[cC]://')
exe_path_unix="${wineprefix}/dosdevices/c:/${exe_win_path_unix}"
log.debug "转换后的 UNIX 路径: $exe_path_unix"
if [[ ! -f "$exe_path_unix" ]]; then
log.info "文件不存在: $exe_path_unix, 删除 $desktop_file"
rm "$desktop_file"
else
log.debug "文件存在: $exe_path_unix"
fi
done
rm -vf ${HOME}/.local/share/applications/wine-*

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Categories=Utility;
Encoding=UTF-8
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher winecfg"
Icon=spark-wine-configure
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Name=Configure Windows App
Name[zh_CN]=Windows 控制面板
StartupWMClass=spark-wine-launcher
Terminal=False
Type=Application
NoDisplay=false

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Categories=Utility;
Encoding=UTF-8
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher %F"
Icon=spark-wine-launcher
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Name=Launch Windows App
Name[zh_CN]=启动Windows应用
StartupWMClass=spark-wine-launcher
Terminal=False
Type=Application
NoDisplay=true

View File

@@ -0,0 +1,13 @@
[Desktop Entry]
Categories=Utility;
Encoding=UTF-8
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher uninstaller"
Icon=spark-wine-uninstaller
MimeType=
Name=Uninstall Windows App
Name[zh_CN]=卸载Windows应用
NoDisplay=false
StartupWMClass=spark-wine-uninstaller
Terminal=False
Type=Application
X-Deepin-Vendor=user-custom

View File

@@ -0,0 +1,66 @@
#!/bin/bash
# ===== Log Functions with Colors =====
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
# Zenity wrapper function
gui_dialog() {
if command -v garma &>/dev/null; then
garma "$@"
else
zenity "$@"
fi
}
# Check if no arguments were passed
if [[ $# -eq 0 ]]; then
gui_dialog --info --text="使用方法:\nUsage:\n\nspark-wine9 <application.exe>\n\n请提供要运行的 Windows 应用程序。\nPlease provide the Windows application to run."
exit 1
fi
# Check if spark-wine9 is installed
if [[ ! -e "/usr/bin/spark-wine9" ]]; then
gui_dialog --question --text="您尚未安装 spark-wine9 ,是否安装以运行 Windows 应用?\nYou haven't installed spark-wine9 yet. Would you like to install it to run Windows applications?"
if [[ $? -ne 0 ]]; then
log.error "User refused to install. Exiting."
exit 1
fi
# Install spark-wine with progress indicator
pkexec bash -c "aptss update && aptss install spark-wine9 spark-wine9-mono -y" | gui_dialog --progress --pulsate --auto-close --no-cancel --text="正在安装,请保持网络畅通,耐心等待\nInstalling, please keep network connection and wait patiently"
INSTALL_STATUS=${PIPESTATUS[0]}
# Check the installation status correctly
if [[ $INSTALL_STATUS -ne 0 ]]; then
gui_dialog --error --text="安装出错,请手动执行以下指令查看错误并反馈:\nError occurred during installation. Please execute the command below to view the error log:\n\nsudo aptss install spark-wine9 spark-wine9-mono -y"
exit 1
fi
fi
# Run spark-wine with WINEPREFIX
export WINEPREFIX="${WINEPREFIX:=$HOME/.deepinwine/spark-wine-custom}"
export APPRUN_CMD="/usr/bin/spark-wine9"
export SHELL_DIR="/opt/spark-dwine-helper"
if [[ "$WINEPREFIX" != $HOME/.deepinwine/spark-wine-custom ]];then
${APPRUN_CMD} "$@"
exit
fi
(
mkdir -p ${WINEPREFIX}
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/set-wine-scale.sh ${WINEPREFIX} &
# ${APPRUN_CMD} reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f &
wait
) | gui_dialog --progress --pulsate --auto-close --no-cancel --text="正在准备应用...\nPreparing Windows APP..."
${APPRUN_CMD} "$@"
/opt/spark-dwine-helper/spark-dwine-helper/spark-wine-desktop-auto-cleanner

View File

@@ -0,0 +1,78 @@
#/bin/bash
SHELL_DIR=$(dirname $(realpath $0))
source /opt/bashimport/transhell.sh
load_transhell_debug
until [ "$IS_CLOSE" = "1" ];do
CHOSEN_SETTINGS=`zenity --list \
--width=700 \
--height=350 \
--title="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" \
--column="${TRANSHELL_CONTENT_OPTION}" \
"${TRANSHELL_CONTENT_SET_APP}" \
"${TRANSHELL_CONTENT_SET_GLOBAL_SCALE}" \
"${TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE}" \
"${TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL}" \
"${TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP}" `
echo "$CHOSEN_SETTINGS"
case "$CHOSEN_SETTINGS" in
"${TRANSHELL_CONTENT_SET_GLOBAL_SCALE}")
########
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
scale_factor=`zenity --list \
--width=700 \
--height=350 \
--title="${TRANSHELL_CONTENT_YOUR_DIMENSION_IS} $dimensions ${TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW}" \
--column="${TRANSHELL_CONTENT_OPTION}" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0`
case "$scale_factor" in
"")
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}" --width=500 --height=150
;;
esac
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
;;
########
"${TRANSHELL_CONTENT_SET_APP}")
bash "${SHELL_DIR}/wine-app-launcher.sh"
;;
"${TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL}")
find ${HOME}/.deepinwine/ -name "scale.txt" -type f -print -exec rm -rf {} \;
zenity --info --text="${TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL}\n`cd ${HOME}/.deepinwine/ && ls`" --width=500 --height=150
;;
"${TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE}")
rm -fv $HOME/.config/spark-wine/scale.txt
zenity --info --text="${TRANSHELL_CONTENT_REMOVED}" --width=500 --height=150
;;
"${TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP}")
;;
*)
IS_CLOSE="1"
;;
esac
done

View File

@@ -0,0 +1,19 @@
#!/bin/bash
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="Welcome to spark wine helper settingsPlease choose one option below to excute"
TRANSHELL_CONTENT_OPTION="Options"
TRANSHELL_CONTENT_SET_GLOBAL_SCALE="Set global scale"
TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE="Remove global scale, follow the detected ENV_VAR"
TRANSHELL_CONTENT_SET_APP="Single App Settings"
TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL="Sync all the wine app scale with global scale in one key"
TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP="Note: The options above only take effect on spark-dwine-helper apps"
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="Your dimension is "
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="Please choose one option below"
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="Setting 1.0 scale as default"
TRANSHELL_CONTENT_SCALE_IS="Scale multiple is "
TRANSHELL_CONTENT_SAVED="Saved."
TRANSHELL_CONTENT_REMOVED="Removed."
TRANSHELL_CONTENT_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY="Please choose the directory the app you want to adjust inPlease choose DIRECTORY instead of file"
TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE="Euser.reg can not be found.This is not a wine bottle"
TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL="Sync with global scale settings"
TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL="Will sync with global scale settings"
TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL="The scale settings of apps in bottle below is already syncd with global scale settings"

View File

@@ -0,0 +1,19 @@
#!/bin/bash
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="欢迎使用星火wine助手控制中心请在以下选项中选择一个执行"
TRANSHELL_CONTENT_OPTION="选项"
TRANSHELL_CONTENT_SET_GLOBAL_SCALE="设置全局缩放"
TRANSHELL_CONTENT_REMOVE_GLOBAL_SCALE="删除全局缩放设置,跟随检测到的环境变量设置"
TRANSHELL_CONTENT_SET_APP="设置单个应用"
TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL="一键将所有已安装应用的缩放设置改为与全局缩放一致"
TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP="备注以上操作仅对使用了spark-dwine-helper的应用生效"
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="您的分辨率是:"
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="请在以下选项中选择一个"
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="默认为1倍缩放。"
TRANSHELL_CONTENT_SCALE_IS="缩放倍数为"
TRANSHELL_CONTENT_SAVED="已保存"
TRANSHELL_CONTENT_REMOVED="已删除"
TRANSHELL_CONTENT_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY="请在接下来的文件选择框选中所需的应用所在的容器文件夹(注意要选择文件夹)"
TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE="错误找不到user.reg.这不是一个wine容器"
TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL="与全局设置同步"
TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL="将会与全局设置同步"
TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL="以下容器中的应用的缩放设置已与全局设置同步"

View File

@@ -1,9 +1,10 @@
#!/bin/bash
# 函数:获取所有应用列表
# 函数:获取所有应用列表
SHELL_DIR=$(dirname $(realpath $0))
apps_list=()
get_apps_list() {
local apps_list=()
local app_dirs=($(find /opt/apps -mindepth 1 -maxdepth 1 -type d -exec test -f {}/files/run.sh \; -print))
if [ ${#app_dirs[@]} -eq 0 ]; then
@@ -25,18 +26,17 @@ get_apps_list() {
if [ -z "$version" ]; then
version="无法读取"
fi
if grep -q "START_SHELL_PATH=\"/opt/deepinwine/tools/spark_run_v4.sh\"" "$run_script"; then
# START_SHELL_PATH=XXX/spark_run_v4.sh
if grep spark_run_v4.sh "$run_script" >/dev/null 2>&1 ; then
use_spark="是"
fi
fi
local app_name=$(get_app_name "$package_name")
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
done
echo "${apps_list[@]}"
}
# 函数:获取应用名称
@@ -56,14 +56,18 @@ get_app_name() {
# 函数:选择应用
select_app() {
local apps_list=($(get_apps_list))
local app=$(zenity --print-column=2 --width=800 --height=600 --list --title="选择应用" --text="选择要执行的应用" --column="应用名" --column="包名" --column="容器名" --column="版本号" --column="是否使用星火wine助手" "${apps_list[@]}")
get_apps_list
for (( i = 0; i < ${#apps_list[@]}; i++ )); do
echo ${apps_list[$i]}
done
local app=$(zenity --print-column=2 --width=800 --height=600 --list --title="选择应用" --text="选择要执行的应用" --column="应用名" --column="包名" --column="容器名" --column="版本号" --column="是否使用星火wine助手" "${apps_list[@]}")
if [ -n "$app" ]; then
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local use_spark="否"
if grep -q "START_SHELL_PATH=\"/opt/deepinwine/tools/spark_run_v4.sh\"" "$run_script"; then
if grep spark_run_v4.sh "$run_script" >/dev/null 2>&1 ; then
use_spark="是"
fi
if [ "$use_spark" == "是" ]; then
@@ -72,12 +76,14 @@ select_app() {
select_non_spark_action "$app" "$(get_app_name $app)"
fi
fi
### 还原分隔符
IFS="$IFS_OLD"
}
select_non_spark_action(){
local app="$1"
local app_name="$2"
local options=("在终端中打开")
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "更多操作")
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
case "$choice" in
"在终端中打开")
@@ -85,14 +91,41 @@ select_non_spark_action(){
local run_script="$app_dir/files/run.sh"
x-terminal-emulator -e "$run_script"
;;
"打开容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name}
;;
"清理并重置容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
$SHELL_DIR/../kill.sh ${bottle_name}
rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/*
zenity --info --width=300 --text="操作已完成请重启Wine应用查看"
;;
"更多操作")
if [ -e /usr/bin/deepin-wine-runner ];then
/usr/bin/deepin-wine-runner
elif [ $(command -v spark-store) ];then
spark-store spk://store/tools/spark-deepin-wine-runner
elif [ $(command -v deepin-home-appstore-client) ];then
xdg-open appstore://deepin-home-appstore-client?app_detail_info/spark-deepin-wine-runner
else
xdg-open https://gitee.com/gfdgd-xi/deep-wine-runner/releases
fi
;;
esac
}
# 函数选择星火wine助手操作
select_spark_action() {
local app="$1"
local app_name="$2"
local options=("在终端中打开" "修改应用缩放" "修改全局缩放")
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "修改应用缩放" "更多操作")
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
case "$choice" in
@@ -101,12 +134,37 @@ select_spark_action() {
local run_script="$app_dir/files/run.sh"
x-terminal-emulator -e "$run_script"
;;
"打开容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name}
;;
"清理并重置容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
$SHELL_DIR/../spark_kill.sh ${bottle_name}
rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/*
zenity --info --width=300 --text="操作已完成请重启Wine应用查看"
;;
"修改应用缩放")
select_scale_action "应用" "$app"
;;
"修改全局缩放")
select_scale_action "全局" "$app"
;;
# "修改全局缩放")
# select_scale_action "全局" "$app"
# ;;
"更多操作")
if [ -e /usr/bin/deepin-wine-runner ];then
/usr/bin/deepin-wine-runner
elif [ $(command -v spark-store) ];then
spark-store spk://store/tools/spark-deepin-wine-runner
elif [ $(command -v deepin-home-appstore-client) ];then
xdg-open appstore://deepin-home-appstore-client?app_detail_info/spark-deepin-wine-runner
else
xdg-open https://gitee.com/gfdgd-xi/deep-wine-runner/releases
fi
;;
*)
;;
esac
@@ -119,7 +177,7 @@ select_scale_action() {
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
local scale_factors=("1.0" "1.25" "1.5" "1.75" "2.0" "恢复默认")
local scale_factors=("1.0" "1.25" "1.5" "1.75" "2.0" "2.5" "3.0" "3.5" "4.0" "恢复默认")
local choice=$(zenity --width=800 --height=600 --list --title="选择缩放比例" --text="选择要设置的缩放比例" --column="比例" "${scale_factors[@]}")
if [ -n "$choice" ]; then
@@ -129,7 +187,7 @@ select_scale_action() {
if [ "$scale_factor" == "恢复默认" ];then
rm $HOME/.deepinwine/$bottle_name/scale.txt
else
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s "$scale_factor" "$HOME/.deepinwine/$bottle_name"
echo "$scale_factor" > "$HOME/.deepinwine/$bottle_name/scale.txt"
fi
elif [ "$scale_type" == "全局" ]; then
if [ "$scale_factor" == "恢复默认" ];then

View File

@@ -1,4 +1,17 @@
#!/bin/bash
##### 若有pybanner则尝试启动
#if [ -e ${SHELL_DIR}/spark-dwine-helper/pybanner/pybanner.py ];then
#echo "Protocol upgrade: Trying to activate python banner..."
#python3 ${SHELL_DIR}/spark-dwine-helper/pybanner/pybanner.py
#if [ "$?" = "0" ];then
#exit
#else
#echo "Failed to activate. Fallback to normal zenity."
#fi
#fi
if [ ! -z "$WAYLAND_DISPLAY" ]; then
echo "Wayland detected. Do not check wmclass"
zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
@@ -11,7 +24,7 @@ zenity --progress --title="星火Windows应用兼容助手" --text="正在为您
exit
fi
target_wmclass=$WINE_WMCLASS
target_wmclass="$WINE_WMCLASS"
function check_window() {
@@ -41,4 +54,4 @@ while true; do
done
}
check_wmclass | zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=10
check_wmclass | zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3

View File

@@ -2,7 +2,9 @@
cd $(dirname $0)
SHELL_DIR=$(dirname $(realpath $0))
runtime_path=/opt/deepinwine/runtime-i386
echo $runtime_path
if [ -f "$runtime_path/init_runtime.sh" ];then
source "$runtime_path/init_runtime.sh"

View File

@@ -2,11 +2,6 @@
#####因为arm版本的deepin-wine-helper不带这个又不想破坏x86兼容性故改名
APP_NAME="QQ"
LOG_FILE=$0
SHELL_DIR=${0%/*}
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
PUBLIC_DIR="/var/public"
UsePublicDir()

View File

@@ -9,10 +9,13 @@
# Modifier: shenmo <shenmo@spark-app.store>
#
#
SHELL_DIR=$(dirname $(realpath $0))
source /opt/durapps/transhell/transhell.sh
export SHELL_DIR
source ${SHELL_DIR}/bashimport/log-function.bashimport
source ${SHELL_DIR}/bashimport/transhell.bashimport
load_transhell_debug
source $(dirname $0)/log-function.bashimport
#########Preload functions
function get_app_name() {
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
@@ -21,6 +24,8 @@ function get_app_name() {
if [ -z "$app_name_i18n" ]; then
app_name="$app_name_orig"
elif [ -z "$app_name_orig" ]; then
app_name="自定义应用"
else
app_name="$app_name_i18n"
fi
@@ -28,18 +33,19 @@ function get_app_name() {
echo "$app_name"
}
######### Vars
BOTTLENAME=""
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
APPVER=""
APPTAR="files.7z"
BOTTLENAME=""
WINE_CMD="deepin-wine"
#这里会被后续覆盖
LOG_FILE=$0
PUBLIC_DIR="/var/public"
if [ -z $WINE_WMCLASS ];then
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
fi
export WINE_APP_NAME=$(get_app_name ${DEB_PACKAGE_NAME})
if [ -z "$WINE_APP_NAME" ];then
export WINE_APP_NAME=$BOTTLENAME
@@ -55,29 +61,12 @@ else
UNPACK_CMD=7z
log.debug "Using system 7z as unpacker"
fi
SHELL_DIR=$(dirname $0)
SHELL_DIR=$(realpath "$SHELL_DIR")
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
if [ $APPRUN_CMD ]; then
WINE_CMD=$APPRUN_CMD
fi
#####################
if [ "$WINE_CMD" = "deepin-wine8-stable" ] && [ "$(arch)" != "x86_64" ];then
WINE_CMD="/opt/durapps/spark-dwine-helper/deepin-wine8-stable-wrapper/deepin-wine8-stable"
log.warn "Using deepin-wine8-stable wrapper to fix arm problem"
fi
#####################
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
##################### Functions
progressbar()
@@ -184,6 +173,10 @@ DisableWrite()
is_autostart()
{
AUTOSTART="/opt/deepinwine/tools/autostart"
if [[ -f "$SHELL_DIR/autostart" ]]; then
# 如果打包时自带 autostart则使用自带的
AUTOSTART="$SHELL_DIR/autostart"
fi
if [ -f "$AUTOSTART.all" ]&&[ -f "/opt/apps/$1/files/run.sh" ];then
return 0
fi
@@ -199,7 +192,7 @@ is_autostart()
Test_GL_wine()
{
gl_wine_path="/opt/deepinwine/tools/spark_gl-wine"
gl_wine_path="${SHELL_DIR}/spark_gl-wine"
#如果不支持32的GLX,d3d改为gdi的实现
if [[ ! -f "${WINEPREFIX}/.init_d3d" ]];then
@@ -252,7 +245,7 @@ CallProcess()
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
fi
# Disable winemenubuilder
env WINE_WMCLASS="$DEB_PACKAGE_NAME" WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
@@ -261,7 +254,8 @@ CallProcess()
debug_log "Starting process $* ..."
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX"
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX"
#$SHELL_DIR/spark-wine-banner &
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@"
#start autobottle
@@ -296,16 +290,18 @@ CallApp()
{
$SHELL_DIR/spark-wine-banner &
FixLink
debug_log "CallApp $BOTTLENAME arg count $#: $*"
if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_run.sh" ];then
source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_run.sh"
CallPreRun "$@"
fi
if [ -e "/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh" ];then
APP_CONFIG_PATH="/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh"
else
APP_CONFIG_PATH="${SHELL_DIR}/spark_run_v4_app_configs/${BOTTLENAME}.sh"
fi
if [ -f "$APP_CONFIG_PATH" ]; then
echo "执行 ${BOTTLENAME}.sh ..."
source $APP_CONFIG_PATH

View File

@@ -0,0 +1 @@
../../opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher

View File

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

View File

@@ -1,13 +0,0 @@
[Desktop Entry]
Categories=Utility;
Encoding=UTF-8
Exec=bash -c "/opt/durapps/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh"
Icon=store.spark-app.spark-dwine-helper
MimeType=
Name=Spark Wine App Launcher
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: 416 KiB

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 72 72" id="emoji" xmlns="http://www.w3.org/2000/svg">
<g id="color">
<path fill="#D0CFCE" stroke="none" d="M13.8627,12.1552c-1.1508,0-2.0876,0.9362-2.0876,2.0876v43.5128c0,1.1508,0.9368,2.0876,2.0876,2.0876 h43.5139c1.1508,0,2.0876-0.9368,2.0876-2.0876V14.2428c0-1.1514-0.9368-2.0876-2.0876-2.0876H13.8627z"/>
<path fill="#9B9B9A" stroke="none" d="M18.3877,47.8604c0-0.5528,1.4504,2.0709,1.4504,2.0709s2.3432,2.9292,4.5493,2.9292s5-2.794,5-5 c0-2.2061-0.7639-4.5707-2.97-4.5707c-0.5527,0-2.5849-1.4257-2.0346-1.4285c-0.0067,0-0.0132-0.0009-0.0198-0.0009 c-1.5741,0-3.002,0.6109-4.0723,1.6024l-1.2249,1.5816c-0.4475,0.84-0.703,1.7979-0.703,2.8161"/>
<path fill="#9B9B9A" stroke="none" d="M50.8994,43.6182c0.3906,0.3906-1.0234,0.5113-1.414,0.1206c-1.5118-1.5117-4.1456-1.7685-5.6573-0.2568 c-0.7558,0.7559-2.3559,2.969-2.3559,4.0374c0,1.0683,0.8929,3.1207,1.6487,3.8766c1.5586,1.5585,4.7518,1.8046,6.3124,0.2461 c0.3906-0.3907,1.8563,0.0683,1.4677,0.459c0.8179-0.8186,1.3997-1.8728,1.6368-3.0517l0.0579-1.9982 c-0.2074-1.5344-0.9886-2.8865-2.128-3.8247C50.6166,43.3495,50.761,43.4797,50.8994,43.6182z"/>
<path fill="#9B9B9A" stroke="none" d="M30.302,24.7566c-0.1589-1.1738-0.6542-2.2388-1.3899-3.095c0.2868,0.4086-0.9581,0.4745-1.3262,0.0629 c-0.7139-0.7949-1.6947-1.0792-2.7611-1.1373c-1.0722-0.0499-2.9824,0.2682-3.7783,0.981 c-0.7949,0.7139-1.6015,2.4796-1.6591,3.5465c-0.0586,1.0674-0.1538,2.4763,0.5601,3.2713 c0.7138,0.7954,3.157,2.3541,4.2244,2.4117c1.0576,0.0508,4.6217-1.235,4.2928-0.8597c0.891-0.8364,1.5295-1.9377,1.7797-3.1826 L30.302,24.7566z"/>
<path fill="#9B9B9A" stroke="none" d="M51.7237,22.3636l-1.3348-1.4893c-0.9584-0.7633-2.1552-1.235-3.4612-1.2935 c0.5337,0.0405-1.3506,1.1086-1.3506,1.1086s-3.8299,2.4771-3.9168,4.6807c-0.086,2.2031,2.6346,5.145,4.8387,5.2329 c2.2002,0.0898,4.958-1.7837,5.0449-3.9873c0.0215-0.5522,1.1056-1.3812,1.1023-0.8443c0.0024-0.0684,0.0104-0.1352,0.0104-0.2042 C52.6566,24.3878,52.3115,23.2913,51.7237,22.3636z"/>
</g>
<g id="hair"/>
<g id="skin"/>
<g id="skin-shadow"/>
<g id="line">
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M56.4636,59.8432h-41.688c-1.6569,0-3-1.3431-3-3v-41.688c0-1.6569,1.3431-3,3-3h41.688c1.6569,0,3,1.3431,3,3v41.688 C59.4636,58.5001,58.1205,59.8432,56.4636,59.8432z"/>
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M51.6525,25.7643c-0.1089,2.7593-2.434,4.9079-5.1932,4.799c-2.7594-0.1089-4.9079-2.434-4.799-5.1932 c0.1089-2.7593,2.4339-4.9079,5.1932-4.799"/>
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M27.7268,29.2886c-2.0552,1.8442-5.2165,1.6732-7.0608-0.382c-1.8442-2.0552-1.6732-5.2165,0.382-7.0608 c2.0552-1.8442,5.2165-1.6732,7.0608,0.382"/>
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M50.1919,51.396c-1.9526,1.9527-5.1184,1.9526-7.071,0c-1.9527-1.9526-1.9527-5.1184,0-7.071c1.9526-1.9526,5.1184-1.9527,7.071,0"/>
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M24.3874,42.8605c2.7614,0,5,2.2386,5,5c0,2.7615-2.2386,5-5,5c-2.7614,0-5-2.2385-5-5"/>
<line x1="24.3874" x2="18.7823" y1="47.8605" y2="43.5674" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
<line x1="53.492" x2="46.6564" y1="48.0799" y2="47.8605" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
<line x1="31.3463" x2="24.1665" y1="25.7985" y2="25.5152" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
<line x1="51.6564" x2="46.6564" y1="21.0804" y2="25.5672" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
</g>

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="144px" height="144px"><g id="Layer_1"><linearGradient id="SVGID_1_" x1="6.001" x2="22.807" y1="29.396" y2="29.396" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#33bef0"/><stop offset="1" stop-color="#22a5e2"/></linearGradient><path fill="url(#SVGID_1_)" d="M22.8,24.5l-3.5,12.1c-3-2.1-6.3-3.7-13.3-0.8l3.4-11.9l0,0C16.4,20.9,19.8,22.4,22.8,24.5z"/><linearGradient id="SVGID_00000064344804604185625220000003582743550301639556_" x1="39.149" x2="17.839" y1="32.84" y2="32.84" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fede00"/><stop offset="1" stop-color="#ffd000"/></linearGradient><path fill="url(#SVGID_00000064344804604185625220000003582743550301639556_)" d="M24.6,25.7l-3.4,11.9 c3,2.1,6.4,3.7,13.4,0.8l3.3-11.6C30.8,29.2,27.7,27.7,24.6,25.7z"/><linearGradient id="SVGID_00000067194281375023334940000000214048285996100276_" x1="10.011" x2="26.828" y1="15.169" y2="15.169" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f44f5a"/><stop offset=".443" stop-color="#ee3d4a"/><stop offset="1" stop-color="#e52030"/></linearGradient><path fill="url(#SVGID_00000067194281375023334940000000214048285996100276_)" d="M23.4,22.3l3.4-12 c-3-2.1-6.4-3.7-13.4-0.8l-3.4,12c2.8-1.2,5-1.7,6.8-1.7C19.6,19.9,21.6,21.1,23.4,22.3z"/><linearGradient id="SVGID_00000104673114758685606420000016406648196720083331_" x1="35.787" x2="19.822" y1="18.835" y2="18.835" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#21ad64"/><stop offset="1" stop-color="#088242"/></linearGradient><path fill="url(#SVGID_00000104673114758685606420000016406648196720083331_)" d="M28.6,11.6l-3.4,12 c3,2.1,6.7,3.8,13.4,0.7l3.4-12C35,15.3,31.7,13.7,28.6,11.6z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,17 @@
<svg width="100" height="100" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- 背景 -->
<rect width="24" height="24" rx="5" fill="#f2f2f2"/>
<!-- 盖子 -->
<path d="M8 4L9 3h6l1 1h3v2H5V4h3z" fill="#888"/>
<!-- 垃圾桶主体(加宽底部) -->
<path d="M6 7h12l-1.5 12H7.5L6 7z" fill="#555"/>
<!-- 竖线,增强立体感 -->
<path d="M8 9v8M10 9v8M12 9v8M14 9v8M16 9v8" stroke="#777" stroke-width="1"/>
<!-- 红色 X 代表卸载 -->
<circle cx="18" cy="6" r="4" fill="#ff5f5f"/>
<path d="M16.5 4.5l3 3m0-3l-3 3" stroke="white" stroke-width="1.5"/>
</svg>

After

Width:  |  Height:  |  Size: 624 B

View File

@@ -40,8 +40,8 @@ echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine
exit
fi
if [ -e /opt/deepinwine/tools/spark_kill.sh ];then
/opt/deepinwine/tools/spark_kill.sh $BOTTLE_NAME
if [ -e /opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_kill.sh ];then
/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_kill.sh $BOTTLE_NAME
###这里注意如果没写BOTTLE_NAME,会把QQ杀了
fi

View File

@@ -1,13 +1,14 @@
function Remove_Bottle_Before_Update(){
chmod -R +w $HOME/.deepinwine/$BOTTLENAME
rm -rf $HOME/.deepinwine/$BOTTLENAME
local BOTTLENAME="容器名"
echo "$HOME/.deepinwine/${BOTTLENAME} is going to be deleted before Update"
chmod -R +w $HOME/.deepinwine/${BOTTLENAME}
rm -rf $HOME/.deepinwine/${BOTTLENAME}
}
#########这是个例子,对于那些需要删除容器再更新的软件用的,不是每个都需要
function CallPreUpdate(){
echo "$HOME/.deepinwine/$BOTTLENAME is going to be deleted before Update"
Remove_Bottle_Before_Update
DeployApp

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
@@ -16,12 +16,40 @@
#######################函数段。下文调用的额外功能会在此处声明
version_gt() { test "$(echo "$@" | tr " " "
" | sort -V | head -n 1)" != "$1"; }
extract_archive()
{
archive=$1
version_file=$2
dest_dir=$3
if [ -f "$archive" ] && [ -n "$dest_dir" ] && [ "$dest_dir" != "." ];then
archive_version=`cat $version_file`
if [ -d "$dest_dir" ];then
if [ -f "$dest_dir/VERSION" ];then
dest_version=`cat $dest_dir/VERSION`
if version_gt "$archive_version" "$dest_version";then
7z x "$archive" -o/"$dest_dir" -aoa
echo "$archive_version" > "$dest_dir/VERSION"
fi
fi
else
mkdir -p $dest_dir
7z x "$archive" -o/"$dest_dir" -aoa
echo "$archive_version" > "$dest_dir/VERSION"
fi
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'
elif grep -Eqi "GXDE" /etc/issue || grep -Eq "GXDE" /etc/*-release; then
DISTRO='GXDE'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
@@ -40,7 +68,18 @@ BOTTLENAME="容器名"
APPVER="版本号"
EXEC_PATH="启动路径"
##### 软件在wine中的启动路径
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
## Priority Policy: 软件自带>spark-dwine-helper>deepin-wine-helper
SHELL_DIR=$(dirname $(realpath $0))
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh" ## Fallback
if [ -e "/opt/deepinwine/tools/spark_run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
fi
## If exist spark dwine helper, then use it as default
if [ -e "$SHELL_DIR/deepinwine/tools/spark_run_v4.sh" ] ;then
# 如果 helper 在 run.sh 相同目录的 deepinwine/tools/spark_run_v4.sh 则可以调用
START_SHELL_PATH="$SHELL_DIR/deepinwine/tools/spark_run_v4.sh"
fi
## If
ENABLE_DOT_NET=""
####若使用spark-wine时需要用到.net则请把ENABLE_DOT_NET设为true同时在依赖中写spark-wine7-mono
#export BOX86_EMU_CMD="/opt/spark-box86/box86"
@@ -72,7 +111,7 @@ DISABLE_ATTACH_FILE_DIALOG=""
##############<<<<<<<<<禁用文件选择工具开始
Get_Dist_Name
#此功能实现参见开头函数段
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ];then
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ]&& [ "$DISTRO" != "GXDE" ];then
DISABLE_ATTACH_FILE_DIALOG="1"
echo "非deepin/UOS默认关闭系统自带的文件选择工具使用Wine的"
echo "如果你想改变这个行为,请到/opt/apps/$DEB_PACKAGE_NAME/files/$0处修改"
@@ -83,7 +122,7 @@ fi
##############<<<<<<<<<屏蔽mono和gecko安装器开始
##默认屏蔽mono和gecko安装器
if [ "$APPRUN_CMD" = "spark-wine7-devel" ] || [ "$APPRUN_CMD" = "spark-wine" ]|| [ "$APPRUN_CMD" = "spark-wine8" ] && [ -z "$ENABLE_DOT_NET" ];then
if [ "$APPRUN_CMD" = "spark-wine9" ] || [ "$APPRUN_CMD" = "spark-wine" ]|| [ "$APPRUN_CMD" = "spark-wine8" ] && [ -z "$ENABLE_DOT_NET" ];then
#export WINEDLLOVERRIDES="mscoree=d,mshtml=d,control.exe=d"
export WINEDLLOVERRIDES="control.exe=d"
@@ -92,6 +131,14 @@ export WINEDLLOVERRIDES="control.exe=d"
fi
##############>>>>>>>>>屏蔽mono和gecko安装器结束
##############<<<<<<<<<解压自行封装的 Wine如果存在的话
if [[ -e "$ARCHIVE_FILE_DIR/wine_archive.7z" ]]; then
WINE_BIN_DIR=`dirname $APPRUN_CMD`
WINE_DIR=`dirname $WINE_BIN_DIR`
extract_archive "$ARCHIVE_FILE_DIR/wine_archive.7z" "$ARCHIVE_FILE_DIR/wine_archive.md5sum" "$WINE_DIR"
fi
##############>>>>>>>>>
#########################执行段
@@ -109,7 +156,7 @@ if [ -n "$EXEC_PATH" ];then
if [ -z "${EXEC_PATH##*.lnk*}" ];then
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
else
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
else
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"