mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2026-05-14 10:00:19 +08:00
开始尝试并入wine helper
This commit is contained in:
39
helper/bashimport/log-function.bashimport
Normal file
39
helper/bashimport/log-function.bashimport
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# ===== 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" $@; }
|
||||||
|
|
||||||
32
helper/bashimport/transhell.bashimport
Executable file
32
helper/bashimport/transhell.bashimport
Executable 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 $@
|
||||||
|
}
|
||||||
|
|
||||||
36
helper/spark-dwine-helper/deepin-wine8-stable-wrapper/deepin-wine8-stable
Executable file
36
helper/spark-dwine-helper/deepin-wine8-stable-wrapper/deepin-wine8-stable
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# ===== 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" $@; }
|
||||||
|
|
||||||
BIN
helper/spark-dwine-helper/pybanner/fallback.png
Executable file
BIN
helper/spark-dwine-helper/pybanner/fallback.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 195 KiB |
127
helper/spark-dwine-helper/pybanner/pybanner.py
Normal file
127
helper/spark-dwine-helper/pybanner/pybanner.py
Normal 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_()
|
||||||
92
helper/spark-dwine-helper/scale-set-helper/bunny.txt
Normal file
92
helper/spark-dwine-helper/scale-set-helper/bunny.txt
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
___
|
||||||
|
( )
|
||||||
|
| | .-. ___ ___ .--. .--.
|
||||||
|
| |/ \ ( )( ) / \ / \
|
||||||
|
| .-. . | | | | ; ,-. ' | .-. ;
|
||||||
|
| | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | |/ |
|
||||||
|
| | | | | | | | | | | | | ' _.'
|
||||||
|
| | | | | | ; ' | ' | | | .'.-.
|
||||||
|
| | | | ' `-' / ' `-' | ' `-' /
|
||||||
|
(___)(___) '.__.' `.__. | `.__.'
|
||||||
|
( `-' ;
|
||||||
|
`.__.
|
||||||
|
___
|
||||||
|
( )
|
||||||
|
| |.-. .---. ___ .-. .--. ___ .-.
|
||||||
|
| / \ / .-, \ ( ) \ / \ ( ) \
|
||||||
|
| .-. | (__) ; | | ' .-. ; | .-. ; | .-. .
|
||||||
|
| | | | .'` | | / (___) | | | | | | | |
|
||||||
|
| | | | / .'| | | | | | | | | | | |
|
||||||
|
| | | | | / | | | | | | | | | | | |
|
||||||
|
| ' | | ; | ; | | | | ' | | | | | |
|
||||||
|
' `-' ; ' `-' | | | ' `-' / | | | |
|
||||||
|
`.__. `.__.'_. (___) `.__.' (___)(___)
|
||||||
|
|
||||||
|
|
||||||
|
___
|
||||||
|
( )
|
||||||
|
| |.-. ___ ___ ___ .-. ___ .-. ___ ___
|
||||||
|
| / \ ( )( ) ( ) \ ( ) \ ( )( )
|
||||||
|
| .-. | | | | | | .-. . | .-. . | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | ' | |
|
||||||
|
| | | | | | | | | | | | | | | | ' `-' |
|
||||||
|
| ' | | | | ; ' | | | | | | | | `.__. |
|
||||||
|
' `-' ; ' `-' / | | | | | | | | ___ | |
|
||||||
|
`.__. '.__.' (___)(___) (___)(___) ( )' |
|
||||||
|
; `-' '
|
||||||
|
.__.'
|
||||||
|
............ .....]OOOo]`....
|
||||||
|
... ........ ...=OOOOOOOOO\..
|
||||||
|
.../OOOOOOO`.... ..=OOO@/[\OOOOO.
|
||||||
|
..=OOOOOOOOO\... .,@OO^/....O@O@`
|
||||||
|
..OOOOOO[[OOO@`. .=OO@,...=.OOOO.
|
||||||
|
..OOOOO./O^,@OO` .=OO^....,.@OO^.
|
||||||
|
..\OOO@^...=OOOO.... .OOO^*..,`/OOO..
|
||||||
|
...\OOOOOOOooooO^... .=OO^...`=OO@`..
|
||||||
|
..=@O@OooOOOOO@`...........=@@O]].,@O@`...
|
||||||
|
.,@OoOO`...O@^......,]]]]/OOOOOOO@@... .
|
||||||
|
...\OO@]]]OOOO@@@@@@@@@@@@@@@@@@@OO.....
|
||||||
|
.....[@@OOO@@@@@@@@@@@@@@@@@@@@@@@@@@`..
|
||||||
|
..OOO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`....
|
||||||
|
.,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\...
|
||||||
|
....=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@^..
|
||||||
|
...=@@@@@@@@@@@@@@@@@@@@@@`,\@@@@@@@@@@@@@^.
|
||||||
|
..,@@@@@@@@@@@@@@@@@@@@@@@O,[].\@@@@@@@@@@@.
|
||||||
|
../@@@@@@@@@@@@O@@@@@@@@@@@......\@@@@@@@@@^
|
||||||
|
.,@@@@@@@@@@@O`.\@@@@@@@@@/........\@@@@@@@@...
|
||||||
|
.=@@@@@@@@@/.....\@@@@@@@@/`...[O`..\@@@@@@@`...
|
||||||
|
.=@@@@@@@^,O[..,`.,@@@@@/../@@O[`...,@@@@@@@....
|
||||||
|
....@@@@@@@O`,@@O[]..,@/[`..=oo@O`,^...@@@@@@@@`..
|
||||||
|
....O@@@@@@@@`,OOO@^*\.........\..../.../@`.=^..
|
||||||
|
.. ...,@^=@@@^.\`...,^...........[[......O]//...
|
||||||
|
..,\]@@@\...[`....................=@@/....
|
||||||
|
.=@@\............,]/`........../@@@\.. .
|
||||||
|
.....@@@@@\.....................,/@@@@@@\...
|
||||||
|
...=@@@@@@@@\]..............]@@@@@@@@@@@@`.
|
||||||
|
...,@@@@@@@@@@@@@@/[\O@@O/[*./@@@@@@@@@@@@@\.......
|
||||||
|
...@@@@@@@@@@@@@@@^.,O@@@@^../@@@@@@@@@@@@@@@\.....
|
||||||
|
..........@@@@@@@@@@@@@@@@@`..`\/`../@@@@@@@@@@@@@@@@@@@@]]
|
||||||
|
........,@@@@@@@@@@@@@@@@/*[\].,`]/[[@@@@@@@@@@@@@@,[[[[`..
|
||||||
|
..,O\/@@@@@@@@@@@@@@@@@@@`...........O@@O@@@@@@@@@@\....
|
||||||
|
.....\@@@@@@@@@@@@@@@@@@@OO\`,O.. .,@OOO@@@@@@@@@@. ..
|
||||||
|
..../@@@@@@@@@@@@@@OO@`.^,O. ..=@OOO@@@@@@@@@.. .
|
||||||
|
...=@@@@@@@@@@@@@@@@@O[[.... ...\@@@@@@@@@@@/.. .
|
||||||
|
...=@@@@@@@@@@@@@@,^ ....O...\@@@@@@`
|
||||||
|
....@@@@@@@@@@@@@/.. ...^/\]/[\@@@@`.
|
||||||
|
.@@@@/@@@@@@@^O..... ...,@@^]..]@/...
|
||||||
|
...\@`.[@@@@@@...... .=`@@@@@^..^....
|
||||||
|
....`....[@@@O\.[,..........OO@@@@@^.,[[....
|
||||||
|
............\@@@\`...,`**,]@@@@@@@^.........
|
||||||
|
.. .,@@@@@@@@@@@@@@@@@@/...
|
||||||
|
..O@@@@@@@@@@@@@@@@@^...
|
||||||
|
..O@@@@@@^...=@@@@@@@...
|
||||||
|
..@@@@@@@\...=@@@@@@@^..
|
||||||
|
.=@@@@@@@@...=@@@@@@@O..
|
||||||
|
.=@@@@@@@@`..=@@@@@@@@..
|
||||||
|
.=@@@O@@@@^..=@@OO@@@@^.
|
||||||
|
.O@OOOOO@O^..=@OOOOOOO^.
|
||||||
|
.Oo/[\O/\O@..=/[\O/\o*O.
|
||||||
|
.O^......=O...^......*/.
|
||||||
|
.=\.....]O^...\\...]//.. .. ........
|
||||||
86
helper/spark-dwine-helper/scale-set-helper/get-scale.sh
Executable file
86
helper/spark-dwine-helper/scale-set-helper/get-scale.sh
Executable file
@@ -0,0 +1,86 @@
|
|||||||
|
#/bin/bash
|
||||||
|
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 "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 \
|
||||||
|
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
|
||||||
|
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
|
||||||
|
|
||||||
210
helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh
Executable file
210
helper/spark-dwine-helper/scale-set-helper/set-wine-scale.sh
Executable file
@@ -0,0 +1,210 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
help() {
|
||||||
|
cat <<EOF
|
||||||
|
用法:$0 [-h|--help] [-s|--set-scale-factor] path
|
||||||
|
-h|--help 显示这个帮助
|
||||||
|
-s|--set-scale-factor 直接指定缩放。支持1.0,1.25,1.5,1.75,2.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.0,1.25,1.5,1.75,2.0,2.5,3.0,3.5,4.0
|
||||||
|
path Wine Container directory path
|
||||||
|
|
||||||
|
This script have super bunny power.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
#########################帮助文件结束#############################
|
||||||
|
|
||||||
|
parse_args() {
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-h|--help)
|
||||||
|
help
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
-s|--set-scale-factor)
|
||||||
|
appointed_scale_factor="$2"
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
|
"bunny")
|
||||||
|
cat ${SHELL_DIR}/spark-dwine-helper/scale-set-helper/bunny.txt
|
||||||
|
exit
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
CONTAINER_PATH="$1"
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
################
|
||||||
|
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设置"
|
||||||
|
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/get-scale.sh "$CONTAINER_PATH"
|
||||||
|
wine_scale=`cat $CONTAINER_PATH/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`
|
||||||
|
|
||||||
|
echo "检测到的缩放倍数为:$wine_scale"
|
||||||
|
echo "Scale is $wine_scale"
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
#####非deepin发行版似乎没有这个变量,暂时不清楚这个变量是哪个组件做的
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
#######指定了缩放倍数
|
||||||
|
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" ] && [ "$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
|
||||||
|
fi
|
||||||
|
#######没问题了再用
|
||||||
|
echo "$appointed_scale_factor" > $CONTAINER_PATH/scale.txt
|
||||||
|
wine_scale=`cat $CONTAINER_PATH/scale.txt`
|
||||||
|
|
||||||
|
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"
|
||||||
|
;;
|
||||||
|
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
|
||||||
|
#####用wine提供的方法
|
||||||
|
|
||||||
|
case "$wine_scale" in
|
||||||
|
1.0*)
|
||||||
|
dpi="96"
|
||||||
|
;;
|
||||||
|
1.25*)
|
||||||
|
dpi="120"
|
||||||
|
;;
|
||||||
|
1.5*)
|
||||||
|
dpi="144"
|
||||||
|
;;
|
||||||
|
1.75*)
|
||||||
|
dpi="168"
|
||||||
|
;;
|
||||||
|
2.0*)
|
||||||
|
dpi="192"
|
||||||
|
;;
|
||||||
|
2.5*)
|
||||||
|
dpi="240"
|
||||||
|
;;
|
||||||
|
3.0*)
|
||||||
|
dpi="288"
|
||||||
|
;;
|
||||||
|
3.5*)
|
||||||
|
dpi="336"
|
||||||
|
;;
|
||||||
|
4.0*)
|
||||||
|
dpi="384"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
dpi="96"
|
||||||
|
#可能不是Xorg或者是其他错误
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "用$APPRUN_CMD执行指令"
|
||||||
|
echo "指令为"
|
||||||
|
echo "env WINEPREFIX="$CONTAINER_PATH" $APPRUN_CMD reg ADD 'HKCU\Control Panel\Desktop' /v LogPixels /t REG_DWORD /d $dpi /f"
|
||||||
|
|
||||||
|
env WINEPREFIX="$CONTAINER_PATH" $APPRUN_CMD reg ADD 'HKCU\Control Panel\Desktop' /v LogPixels /t REG_DWORD /d $dpi /f
|
||||||
|
|
||||||
|
fi
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
TRANSHELL_CONTENT_OPTION="Options"
|
||||||
|
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_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST="You can use spark wine helper settings to adjust settings"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
TRANSHELL_CONTENT_OPTION="选项"
|
||||||
|
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_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST="您可以使用星火wine助手设置来重新设置"
|
||||||
201
helper/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh
Executable file
201
helper/spark-dwine-helper/wine-app-launcher/wine-app-launcher.sh
Executable file
@@ -0,0 +1,201 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SHELL_DIR=$(dirname $(realpath $0))
|
||||||
|
|
||||||
|
# 函数:获取所有应用列表
|
||||||
|
# 函数:获取所有应用列表
|
||||||
|
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
|
||||||
|
zenity --error --text="请至少在应用商店安装一个wine应用后启动" --width 200
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for app_dir in "${app_dirs[@]}"; do
|
||||||
|
local package_name=$(basename "$app_dir")
|
||||||
|
local run_script="$app_dir/files/run.sh"
|
||||||
|
local bottle_name="无法读取"
|
||||||
|
local version="无法读取"
|
||||||
|
local use_spark="否"
|
||||||
|
|
||||||
|
if [ -f "$run_script" ]; then
|
||||||
|
bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
|
||||||
|
version=$(grep -oP 'APPVER="\K[^"]+' "$run_script")
|
||||||
|
|
||||||
|
if [ -z "$version" ]; then
|
||||||
|
version="无法读取"
|
||||||
|
fi
|
||||||
|
# START_SHELL_PATH=XXX/spark_run_v4.sh
|
||||||
|
if grep START_SHELL_PATH= "$run_script" | grep spark_run_v4.sh; then
|
||||||
|
use_spark="是"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
local app_name=$(get_app_name "$package_name")
|
||||||
|
|
||||||
|
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "${apps_list[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 函数:获取应用名称
|
||||||
|
get_app_name() {
|
||||||
|
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||||
|
local app_name_i18n=$(grep -m 1 "^Name\[$LANGUAGE\]\=" "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||||
|
local app_name=""
|
||||||
|
|
||||||
|
if [ -z "$app_name_i18n" ]; then
|
||||||
|
app_name="$app_name_orig"
|
||||||
|
else
|
||||||
|
app_name="$app_name_i18n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$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[@]}")
|
||||||
|
|
||||||
|
if [ -n "$app" ]; then
|
||||||
|
local app_dir="/opt/apps/$app"
|
||||||
|
local run_script="$app_dir/files/run.sh"
|
||||||
|
local use_spark="否"
|
||||||
|
if if grep START_SHELL_PATH= "$run_script" | grep spark_run_v4.sh; then
|
||||||
|
use_spark="是"
|
||||||
|
fi
|
||||||
|
if [ "$use_spark" == "是" ]; then
|
||||||
|
select_spark_action "$app" "$(get_app_name $app)"
|
||||||
|
else
|
||||||
|
select_non_spark_action "$app" "$(get_app_name $app)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
select_non_spark_action(){
|
||||||
|
local app="$1"
|
||||||
|
local app_name="$2"
|
||||||
|
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "更多操作")
|
||||||
|
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
|
||||||
|
case "$choice" in
|
||||||
|
"在终端中打开")
|
||||||
|
local app_dir="/opt/apps/$app"
|
||||||
|
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 choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
|
||||||
|
|
||||||
|
case "$choice" in
|
||||||
|
"在终端中打开")
|
||||||
|
local app_dir="/opt/apps/$app"
|
||||||
|
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"
|
||||||
|
;;
|
||||||
|
"更多操作")
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# 函数:选择缩放操作
|
||||||
|
select_scale_action() {
|
||||||
|
local scale_type="$1"
|
||||||
|
local app="$2"
|
||||||
|
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" "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
|
||||||
|
local scale_factor="$choice"
|
||||||
|
|
||||||
|
if [ "$scale_type" == "应用" ]; then
|
||||||
|
if [ "$scale_factor" == "恢复默认" ];then
|
||||||
|
rm $HOME/.deepinwine/$bottle_name/scale.txt
|
||||||
|
else
|
||||||
|
$SHELL_DIR/scale-set-helper/set-wine-scale.sh -s "$scale_factor" "$HOME/.deepinwine/$bottle_name"
|
||||||
|
fi
|
||||||
|
elif [ "$scale_type" == "全局" ]; then
|
||||||
|
if [ "$scale_factor" == "恢复默认" ];then
|
||||||
|
rm $HOME/.config/spark-wine/scale.txt
|
||||||
|
else
|
||||||
|
echo "$scale_factor" > "$HOME/.config/spark-wine/scale.txt"
|
||||||
|
find "$HOME/.deepinwine/" -name "scale.txt" -type f -print -exec rm -rf {} \;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
zenity --info --width=300 --text="操作已完成,请重启Wine应用查看"
|
||||||
|
}
|
||||||
|
|
||||||
|
select_app
|
||||||
|
|
||||||
57
helper/spark-wine-banner
Executable file
57
helper/spark-wine-banner
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/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
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$(which wmctrl)" ]; then
|
||||||
|
echo "No wmctrl installed. Do not check wmclass"
|
||||||
|
zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
target_wmclass="$WINE_WMCLASS"
|
||||||
|
|
||||||
|
|
||||||
|
function check_window() {
|
||||||
|
# 使用 wmctrl 命令列出所有窗口,并使用 grep 过滤出特定的 WMCLASS
|
||||||
|
windows=$(wmctrl -lx | grep "$target_wmclass")
|
||||||
|
|
||||||
|
# 如果窗口存在,则关闭提示
|
||||||
|
if [ -n "$windows" ]; then
|
||||||
|
# 提取窗口ID
|
||||||
|
window_id=$(echo "$windows" | awk '{print $1}')
|
||||||
|
|
||||||
|
echo "Window with WMCLASS '$target_wmclass' found"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "Window with WMCLASS '$target_wmclass' not found."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_wmclass(){
|
||||||
|
# 递归检测窗口是否存在的函数
|
||||||
|
|
||||||
|
# 每隔一段时间检测一次窗口是否存在
|
||||||
|
while true; do
|
||||||
|
check_window
|
||||||
|
# 等待一段时间后再次检测
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
check_wmclass | zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=20
|
||||||
22
helper/spark_get_tray_window
Executable file
22
helper/spark_get_tray_window
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# vim: set ts=4 sw=4 fileencoding=utf-8:
|
||||||
|
# Luomio <nohappiness@gmail.com>
|
||||||
|
# Filename: dde-first-run.py
|
||||||
|
# Create Date: 27-03, 13
|
||||||
|
|
||||||
|
import dbus
|
||||||
|
|
||||||
|
def get_tray_window():
|
||||||
|
bus = dbus.SessionBus()
|
||||||
|
traymanager = bus.get_object("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager")
|
||||||
|
|
||||||
|
traymanager_iface = dbus.Interface(traymanager, dbus_interface='org.freedesktop.DBus.Properties')
|
||||||
|
windows = traymanager_iface.Get("com.deepin.dde.TrayManager","TrayIcons")
|
||||||
|
str="window_id:"
|
||||||
|
for i in range(len(windows)):
|
||||||
|
str += '{:#x} '.format(windows[i])
|
||||||
|
|
||||||
|
print(str)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
get_tray_window()
|
||||||
BIN
helper/spark_gl-wine/gdid3d.reg
Normal file
BIN
helper/spark_gl-wine/gdid3d.reg
Normal file
Binary file not shown.
BIN
helper/spark_gl-wine/gl-wine32
Executable file
BIN
helper/spark_gl-wine/gl-wine32
Executable file
Binary file not shown.
BIN
helper/spark_gl-wine/gl-wine64
Executable file
BIN
helper/spark_gl-wine/gl-wine64
Executable file
Binary file not shown.
19
helper/spark_gl-wine/run_gl.sh
Executable file
19
helper/spark_gl-wine/run_gl.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#/bin/bash
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
init_runtime
|
||||||
|
init_32bit_config
|
||||||
|
echo "use deepinwine runtime"
|
||||||
|
"$WINELDPATH" ./gl-wine32
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
./gl-wine32
|
||||||
|
exit $?
|
||||||
272
helper/spark_kill.sh
Executable file
272
helper/spark_kill.sh
Executable file
@@ -0,0 +1,272 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#####因为arm版本的deepin-wine-helper不带这个,又不想破坏x86兼容性,故改名
|
||||||
|
APP_NAME="QQ"
|
||||||
|
LOG_FILE=$0
|
||||||
|
PUBLIC_DIR="/var/public"
|
||||||
|
|
||||||
|
UsePublicDir()
|
||||||
|
{
|
||||||
|
if [ -z "$USE_PUBLIC_DIR" ]; then
|
||||||
|
echo "Don't use public dir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ ! -d "$PUBLIC_DIR" ];then
|
||||||
|
echo "Not found $PUBLIC_DIR"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ ! -r "$PUBLIC_DIR" ];then
|
||||||
|
echo "Can't read for $PUBLIC_DIR"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ ! -w "$PUBLIC_DIR" ];then
|
||||||
|
echo "Can't write for $PUBLIC_DIR"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ ! -x "$PUBLIC_DIR" ];then
|
||||||
|
echo "Can't excute for $PUBLIC_DIR"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
WINE_BOTTLE="$HOME/.deepinwine"
|
||||||
|
|
||||||
|
if UsePublicDir;then
|
||||||
|
WINE_BOTTLE="$PUBLIC_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
get_wine_by_pid()
|
||||||
|
{
|
||||||
|
wine_path=$(cat /proc/$1/maps | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1 | awk '{print $6}')
|
||||||
|
if [ -z "$wine_path" ];then
|
||||||
|
cat /proc/$1/cmdline| xargs -0 -L1 -I{} echo {} | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1
|
||||||
|
else
|
||||||
|
echo $wine_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_wine_process()
|
||||||
|
{
|
||||||
|
wine_module=$(get_wine_by_pid $1)
|
||||||
|
if [ -z "$wine_module" ];then
|
||||||
|
wine_module=$(cat /proc/$1/maps | grep -E "\/wineserver$" | head -1)
|
||||||
|
fi
|
||||||
|
echo $wine_module
|
||||||
|
}
|
||||||
|
|
||||||
|
get_prefix_by_pid()
|
||||||
|
{
|
||||||
|
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEPREFIX)
|
||||||
|
WINE_PREFIX=${WINE_PREFIX##*=}
|
||||||
|
if [ -z "$WINE_PREFIX" ] && [ -n "$(is_wine_process $1)" ]; then
|
||||||
|
#不指定容器的情况用默认容器目录
|
||||||
|
WINE_PREFIX="$HOME/.wine"
|
||||||
|
fi
|
||||||
|
if [ -n "$WINE_PREFIX" ];then
|
||||||
|
WINE_PREFIX=$(realpath $WINE_PREFIX)
|
||||||
|
echo $WINE_PREFIX
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_wineserver()
|
||||||
|
{
|
||||||
|
if [ -z "$1" ];then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
targ_prefix=$(realpath $1)
|
||||||
|
ps -ef | grep wineserver | while read server_info ;do
|
||||||
|
debug_log_to_file "get server info: $server_info"
|
||||||
|
server_pid=$(echo $server_info | awk '{print $2}')
|
||||||
|
server_prefix=$(get_prefix_by_pid $server_pid)
|
||||||
|
debug_log_to_file "get server pid $server_pid, prefix: $server_prefix"
|
||||||
|
|
||||||
|
if [ "$targ_prefix" = "$server_prefix" ];then
|
||||||
|
server=$(echo $server_info | awk '{print $NF}')
|
||||||
|
if [ "-p0" = "$server" ];then
|
||||||
|
server=$(echo $server_info | awk '{print $(NF-1)}')
|
||||||
|
fi
|
||||||
|
debug_log_to_file "get server $server"
|
||||||
|
echo $server
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
init_log_file()
|
||||||
|
{
|
||||||
|
if [ -d "$DEBUG_LOG" ];then
|
||||||
|
LOG_DIR=$(realpath $DEBUG_LOG)
|
||||||
|
if [ -d "$LOG_DIR" ];then
|
||||||
|
LOG_FILE="${LOG_DIR}/${LOG_FILE##*/}.log"
|
||||||
|
echo "" > "$LOG_FILE"
|
||||||
|
debug_log "LOG_FILE=$LOG_FILE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_log_to_file()
|
||||||
|
{
|
||||||
|
if [ -d "$DEBUG_LOG" ];then
|
||||||
|
strDate=$(date)
|
||||||
|
echo -e "${strDate}:${1}" >> "$LOG_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_log()
|
||||||
|
{
|
||||||
|
strDate=$(date)
|
||||||
|
echo "${strDate}:${1}"
|
||||||
|
}
|
||||||
|
|
||||||
|
init_log_file
|
||||||
|
|
||||||
|
get_bottle_path_by_process_id()
|
||||||
|
{
|
||||||
|
PID_LIST="$1"
|
||||||
|
PREFIX_LIST=""
|
||||||
|
|
||||||
|
for pid_var in $PID_LIST ; do
|
||||||
|
WINE_PREFIX=$(get_prefix_by_pid $pid_var)
|
||||||
|
#去掉重复项
|
||||||
|
for path in $(echo -e $PREFIX_LIST) ; do
|
||||||
|
if [[ $path == "$WINE_PREFIX" ]]; then
|
||||||
|
WINE_PREFIX=""
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -d "$WINE_PREFIX" ]; then
|
||||||
|
debug_log_to_file "found $pid_var : $WINE_PREFIX"
|
||||||
|
PREFIX_LIST+="\n$WINE_PREFIX"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo -e $PREFIX_LIST
|
||||||
|
}
|
||||||
|
|
||||||
|
get_pid_by_process_name()
|
||||||
|
{
|
||||||
|
PID_LIST=""
|
||||||
|
for pid_var in $(ps -ef | grep -E -i "$1" | grep -v grep | awk '{print $2}');do
|
||||||
|
#通过判断是否加载wine来判断是不是wine进程
|
||||||
|
if [ -n "$(is_wine_process $pid_var)" ];then
|
||||||
|
PID_LIST+=" $pid_var"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "$PID_LIST"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_bottle_path_by_process_name()
|
||||||
|
{
|
||||||
|
PID_LIST=$(get_pid_by_process_name $1)
|
||||||
|
debug_log_to_file "get pid list: $PID_LIST"
|
||||||
|
get_bottle_path_by_process_id "$PID_LIST"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_bottle_path()
|
||||||
|
{
|
||||||
|
if [ -z "$1" ];then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$1/user.reg" ]; then
|
||||||
|
realpath "$1"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$WINE_BOTTLE/$1/user.reg" ]; then
|
||||||
|
realpath "$WINE_BOTTLE/$1"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
get_bottle_path_by_process_name "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
kill_app()
|
||||||
|
{
|
||||||
|
debug_log "try to kill $1"
|
||||||
|
for path in $(get_bottle_path $1); do
|
||||||
|
if [ -n "$path" ];then
|
||||||
|
WINESERVER=$(get_wineserver "$path")
|
||||||
|
|
||||||
|
if [ -f "$WINESERVER" ];then
|
||||||
|
debug_log "kill $path by $WINESERVER"
|
||||||
|
env WINEPREFIX="$path" "$WINESERVER" -k
|
||||||
|
fi
|
||||||
|
|
||||||
|
PID_LIST=$(get_pid_by_process_name "exe|wine")
|
||||||
|
for tag_pid in $PID_LIST; do
|
||||||
|
bottle=$(get_bottle_path_by_process_id "$tag_pid")
|
||||||
|
bottle=${bottle:1}
|
||||||
|
if [ "$path" = "$bottle" ];then
|
||||||
|
echo "kill $tag_pid for $bottle"
|
||||||
|
kill -9 $tag_pid
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
#Kill defunct process
|
||||||
|
ps -ef | grep -E "$USER.*exe.*<defunct>"
|
||||||
|
ps -ef | grep -E "$USER.*exe.*<defunct>" | grep -v grep | awk '{print $2}' | xargs -i kill -9 {}
|
||||||
|
}
|
||||||
|
|
||||||
|
get_tray_window()
|
||||||
|
{
|
||||||
|
$SHELL_DIR/spark_get_tray_window | awk -F: '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
get_stacking_window()
|
||||||
|
{
|
||||||
|
xprop -root _NET_CLIENT_LIST_STACKING | awk -F# '{print $2}' | sed -e 's/, / /g'
|
||||||
|
}
|
||||||
|
|
||||||
|
get_window_pid()
|
||||||
|
{
|
||||||
|
for winid in $(echo "$1" | sed -e 's/ /\n/g') ;
|
||||||
|
do
|
||||||
|
xprop -id $winid _NET_WM_PID | awk -F= '{print $2}'
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
get_window_bottle()
|
||||||
|
{
|
||||||
|
debug_log_to_file "get_window_bottle $1"
|
||||||
|
PID_LIST=$(get_window_pid "$1")
|
||||||
|
debug_log_to_file "get_window_bottle pid list: $PID_LIST"
|
||||||
|
get_bottle_path_by_process_id "$PID_LIST"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_active_bottles()
|
||||||
|
{
|
||||||
|
TRAYWINDOWS=$(get_tray_window)
|
||||||
|
STACKINGWINDOWS=$(get_stacking_window)
|
||||||
|
debug_log_to_file "tray window id: $TRAYWINDOWS"
|
||||||
|
debug_log_to_file "stacking window id: $STACKINGWINDOWS"
|
||||||
|
PID_LIST="$TRAYWINDOWS $STACKINGWINDOWS"
|
||||||
|
get_window_bottle "$PID_LIST"
|
||||||
|
}
|
||||||
|
|
||||||
|
kill_exit_block_app()
|
||||||
|
{
|
||||||
|
TAGBOTTLE=$(get_bottle_path $1)
|
||||||
|
debug_log "tag bottle: $TAGBOTTLE"
|
||||||
|
ACTIVEBOTTLES=$(get_active_bottles)
|
||||||
|
debug_log "active bottles: $ACTIVEBOTTLES"
|
||||||
|
|
||||||
|
if [[ "$ACTIVEBOTTLES" != *"$TAGBOTTLE"* ]]; then
|
||||||
|
kill_app "$TAGBOTTLE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#get_active_bottles
|
||||||
|
#exit
|
||||||
|
|
||||||
|
debug_log "kill $1 $2"
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
APP_NAME="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$2" = "block" ]; then
|
||||||
|
kill_exit_block_app $APP_NAME $3
|
||||||
|
else
|
||||||
|
kill_app $APP_NAME
|
||||||
|
fi
|
||||||
500
helper/spark_run_v4.sh
Executable file
500
helper/spark_run_v4.sh
Executable file
@@ -0,0 +1,500 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (C) 2016 Deepin, Inc.
|
||||||
|
# Copyright (C) 2022 The Spark Project
|
||||||
|
#
|
||||||
|
# Author: Li LongYu <lilongyu@linuxdeepin.com>
|
||||||
|
# Peng Hao <penghao@linuxdeepin.com>
|
||||||
|
#
|
||||||
|
# Modifier: shenmo <shenmo@spark-app.store>
|
||||||
|
#
|
||||||
|
#
|
||||||
|
SHELL_DIR=$(dirname $(realpath $0))
|
||||||
|
|
||||||
|
export SHELL_DIR
|
||||||
|
source ${SHELL_DIR}/bashimport/log-function.bashimport
|
||||||
|
source ${SHELL_DIR}/bashimport/transhell.bashimport
|
||||||
|
load_transhell_debug
|
||||||
|
|
||||||
|
#########Preload functions
|
||||||
|
function get_app_name() {
|
||||||
|
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||||
|
local app_name_i18n=$(grep -m 1 "^Name\[$LANGUAGE\]\=" "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
|
||||||
|
local app_name=""
|
||||||
|
|
||||||
|
if [ -z "$app_name_i18n" ]; then
|
||||||
|
app_name="$app_name_orig"
|
||||||
|
else
|
||||||
|
app_name="$app_name_i18n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$app_name"
|
||||||
|
}
|
||||||
|
######### Vars
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e /opt/p7zip-legacy/bin/7z ];then
|
||||||
|
log.debug "Using p7zip-legacy as unpacker"
|
||||||
|
UNPACK_CMD=/opt/p7zip-legacy/bin/7z
|
||||||
|
else
|
||||||
|
UNPACK_CMD=7z
|
||||||
|
log.debug "Using system 7z as unpacker"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ $APPRUN_CMD ]; then
|
||||||
|
WINE_CMD=$APPRUN_CMD
|
||||||
|
fi
|
||||||
|
|
||||||
|
#####################
|
||||||
|
|
||||||
|
if [ "$WINE_CMD" = "deepin-wine8-stable" ] && [ "$(arch)" != "x86_64" ];then
|
||||||
|
|
||||||
|
WINE_CMD="${SHELL_DIR}/spark-dwine-helper/deepin-wine8-stable-wrapper/deepin-wine8-stable"
|
||||||
|
log.warn "Using deepin-wine8-stable wrapper to fix arm problem"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
##################### Functions
|
||||||
|
progressbar()
|
||||||
|
{
|
||||||
|
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close --no-cancel ||
|
||||||
|
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_DeleteRegistry()
|
||||||
|
{
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg DELETE "$1" /f &> /dev/null
|
||||||
|
}
|
||||||
|
#########功能:删除注册表
|
||||||
|
init_log_file()
|
||||||
|
{
|
||||||
|
if [ ! -d "$DEBUG_LOG" ];then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_DIR=$(realpath $DEBUG_LOG)
|
||||||
|
if [ -d "$LOG_DIR" ];then
|
||||||
|
LOG_FILE="${LOG_DIR}/${LOG_FILE##*/}.log"
|
||||||
|
echo "" > "$LOG_FILE"
|
||||||
|
debug_log "LOG_FILE=$LOG_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_log_to_file()
|
||||||
|
{
|
||||||
|
if [ -d "$DEBUG_LOG" ];then
|
||||||
|
echo -e "${1}" >> "$LOG_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_log()
|
||||||
|
{
|
||||||
|
log.debug "${1}"
|
||||||
|
}
|
||||||
|
################log相关功能
|
||||||
|
HelpApp()
|
||||||
|
{
|
||||||
|
echo " Extra Commands:"
|
||||||
|
echo " -r/--reset Reset app to fix errors"
|
||||||
|
echo " -e/--remove Remove deployed app files"
|
||||||
|
echo " -h/--help Show program help info"
|
||||||
|
}
|
||||||
|
#############帮助文件
|
||||||
|
|
||||||
|
check_link()
|
||||||
|
{
|
||||||
|
if [ ! -d "$1" ];then
|
||||||
|
echo "$1 不是目录,不能创建$2软连接"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
link_path=$(realpath "$2")
|
||||||
|
target_path=$(realpath "$1")
|
||||||
|
if [ "$link_path" != "$target_path" ];then
|
||||||
|
if [ -d "$2" ];then
|
||||||
|
mv "$2" "${2}.bak"
|
||||||
|
else
|
||||||
|
rm "$2"
|
||||||
|
fi
|
||||||
|
echo "修复$2软连接为$1"
|
||||||
|
ln -s -f "$1" "$2"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
FixLink()
|
||||||
|
{
|
||||||
|
if [ -d ${WINEPREFIX} ]; then
|
||||||
|
CUR_DIR=$PWD
|
||||||
|
cd "${WINEPREFIX}/dosdevices"
|
||||||
|
check_link ../drive_c c:
|
||||||
|
check_link / z:
|
||||||
|
check_link $HOME y:
|
||||||
|
cd "../drive_c/users/$USER"
|
||||||
|
check_link "$HOME/Desktop" Desktop
|
||||||
|
check_link "$HOME/Downloads" Downloads
|
||||||
|
# Link to Document
|
||||||
|
if [ -L "$WINEPREFIX/drive_c/users/$(whoami)/My Documents" ]; then
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\My Documents" /f
|
||||||
|
|
||||||
|
else
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\Documents" /f
|
||||||
|
|
||||||
|
fi
|
||||||
|
cd $CUR_DIR
|
||||||
|
#ls -l "${WINEPREFIX}/dosdevices"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
###########会在应用启动和解压时执行,驱动器绑定
|
||||||
|
DisableWrite()
|
||||||
|
{
|
||||||
|
if [ -d "${1}" ]; then
|
||||||
|
chmod +w "${1}"
|
||||||
|
rm -rf "${1}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir "${1}"
|
||||||
|
chmod -w "${1}"
|
||||||
|
}
|
||||||
|
########如果有该文件夹则删除,然后再创建一个不允许写入的
|
||||||
|
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
|
||||||
|
|
||||||
|
if [ -f $AUTOSTART ];then
|
||||||
|
grep -c "$1" $AUTOSTART > /dev/null
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
#########自动启动相关,等用到了再研究
|
||||||
|
|
||||||
|
Test_GL_wine()
|
||||||
|
{
|
||||||
|
gl_wine_path="${SHELL_DIR}/spark_gl-wine"
|
||||||
|
|
||||||
|
#如果不支持32的GLX,d3d改为gdi的实现
|
||||||
|
if [[ ! -f "${WINEPREFIX}/.init_d3d" ]];then
|
||||||
|
if [[ $WINE_CMD == *"deepin-wine8-stable"* ]];then
|
||||||
|
gl_wine="${gl_wine_path}/gl-wine64"
|
||||||
|
else
|
||||||
|
gl_wine="${gl_wine_path}/run_gl.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
run_gl=`${gl_wine} 2>&1`
|
||||||
|
|
||||||
|
#如果opengl测试程序运行失败,所有进程的渲染方式改为gdi渲染模式
|
||||||
|
if [ $? != 0 ];then
|
||||||
|
WINEPREFIX="$WINEPREFIX" $WINE_CMD regedit /S "${gl_wine_path}/gdid3d.reg"
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch "${WINEPREFIX}/.init_d3d"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
||||||
|
#######url转义
|
||||||
|
|
||||||
|
#arg 1: windows process file path
|
||||||
|
#arg 2-*: windows process args
|
||||||
|
CallProcess()
|
||||||
|
{
|
||||||
|
#get file full path
|
||||||
|
path="$1"
|
||||||
|
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
|
||||||
|
path=$(echo ${path//\\/\/})
|
||||||
|
|
||||||
|
#kill bloack process
|
||||||
|
is_autostart $DEB_PACKAGE_NAME
|
||||||
|
autostart=$?
|
||||||
|
if [[ $autostart -ne 0 ]] && [[ "$1" != *"pluginloader.exe" ]];then
|
||||||
|
$SHELL_DIR/spark_kill.sh "$BOTTLENAME" block
|
||||||
|
fi
|
||||||
|
#run gl-wine for test opengl
|
||||||
|
get_arch=`uname -m`
|
||||||
|
if [[ $get_arch = "x86_64" ]];then
|
||||||
|
Test_GL_wine
|
||||||
|
fi
|
||||||
|
#change current dir to excute path
|
||||||
|
path=$(dirname "$path")
|
||||||
|
cd "$path"
|
||||||
|
pwd
|
||||||
|
|
||||||
|
#Set default mime type
|
||||||
|
if [ -n "$MIME_TYPE" ]; then
|
||||||
|
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||||
|
fi
|
||||||
|
# Disable winemenubuilder
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
debug_log "Starting process $* ..."
|
||||||
|
|
||||||
|
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
|
||||||
|
${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
|
||||||
|
if [ $autostart -eq 0 ];then
|
||||||
|
$SHELL_DIR/autostart_wine.sh $DEB_PACKAGE_NAME
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
###通用启动APP逻辑。对于没有被case捕捉的非适配APP,则直接执行此部分。似乎已经有了防止残留的功能
|
||||||
|
###一些自定义的应用不会使用这个启动,而另一些则会调用这个
|
||||||
|
###有设置mimetype和自动启动(这个暂时没分析)的功能
|
||||||
|
|
||||||
|
###########专属优化段:
|
||||||
|
|
||||||
|
|
||||||
|
UnixUriToDosPath()
|
||||||
|
{
|
||||||
|
OPEN_FILE="$1"
|
||||||
|
if [ -f "$OPEN_FILE" ]; then
|
||||||
|
OPEN_FILE=$(realpath "$OPEN_FILE")
|
||||||
|
OPEN_FILE="z:$OPEN_FILE"
|
||||||
|
OPEN_FILE=$(echo $OPEN_FILE | sed -e 's/\//\\\\/g')
|
||||||
|
fi
|
||||||
|
echo $OPEN_FILE
|
||||||
|
}
|
||||||
|
|
||||||
|
#arg 1: exec file path
|
||||||
|
#arg 2: autostart ,or exec arg 1
|
||||||
|
#arg 3: exec arg 2
|
||||||
|
|
||||||
|
#### CallApp段,根据容器名找专属优化,没有就走通用启动
|
||||||
|
CallApp()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
else
|
||||||
|
echo "$APP_CONFIG_PATH 文件不存在,执行通用启动"
|
||||||
|
CallProcess "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
ExtractApp()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
local tmp_log=$(mktemp)
|
||||||
|
mkdir -p "$1"
|
||||||
|
(${UNPACK_CMD} x "$APPDIR/$APPTAR" -o"$1" -bsp1 -bb1 -bse2 | grep --line-buffered -oP "(\d+(\.\d+)?(?=%))" > $tmp_log)&
|
||||||
|
|
||||||
|
cmd_pid=$!
|
||||||
|
(while kill -0 $cmd_pid 2> /dev/null; do
|
||||||
|
tail -n 1 "${tmp_log}"
|
||||||
|
sleep 1
|
||||||
|
done)| zenity --progress --title="${TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL}" --text="${TRANSHELL_CONTENT_UNPACKING} $WINE_APP_NAME..." --width=600 --auto-close --no-cancel
|
||||||
|
rm $tmp_log
|
||||||
|
|
||||||
|
|
||||||
|
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
|
||||||
|
sed -i "s#@current_user@#$USER#" $1/*.reg
|
||||||
|
FixLink
|
||||||
|
}
|
||||||
|
DeployApp()
|
||||||
|
{
|
||||||
|
ExtractApp "$WINEPREFIX"
|
||||||
|
|
||||||
|
|
||||||
|
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
|
||||||
|
|
||||||
|
}
|
||||||
|
RemoveApp()
|
||||||
|
{
|
||||||
|
rm -rf "$WINEPREFIX"
|
||||||
|
}
|
||||||
|
ResetApp()
|
||||||
|
{
|
||||||
|
debug_log "Reset $PACKAGENAME....."
|
||||||
|
read -p "* Are you sure?(Y/N)" ANSWER
|
||||||
|
if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o -z "$ANSWER" ]; then
|
||||||
|
EvacuateApp
|
||||||
|
DeployApp
|
||||||
|
CallApp
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
UpdateApp()
|
||||||
|
{
|
||||||
|
if [ -d "${WINEPREFIX}.tmpdir" ]; then
|
||||||
|
rm -rf "${WINEPREFIX}.tmpdir"
|
||||||
|
fi
|
||||||
|
if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh" ];then
|
||||||
|
source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh"
|
||||||
|
CallPreUpdate
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
case $BOTTLENAME in
|
||||||
|
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding" | "Wine-QQ" | "Spark-QQ" | "Spark-weixin")
|
||||||
|
rm -rf "$WINEPREFIX"
|
||||||
|
DeployApp
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ExtractApp "${WINEPREFIX}.tmpdir"
|
||||||
|
$SHELL_DIR/spark_updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
|
||||||
|
|
||||||
|
|
||||||
|
rm -rf "${WINEPREFIX}.tmpdir"
|
||||||
|
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
|
||||||
|
}
|
||||||
|
RunApp()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
progpid=$(ps -ef | grep "zenity --progress --title=${BOTTLENAME}" | grep -v grep)
|
||||||
|
debug_log "run ${BOTTLENAME} progress pid $progpid"
|
||||||
|
if [ -n "$progpid" ]; then
|
||||||
|
debug_log "$BOTTLENAME is running"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "$WINEPREFIX" ]; then
|
||||||
|
if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then
|
||||||
|
UpdateApp
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
DeployApp
|
||||||
|
fi
|
||||||
|
|
||||||
|
CallApp "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateBottle()
|
||||||
|
{
|
||||||
|
if [ -d "$WINEPREFIX" ]; then
|
||||||
|
if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then
|
||||||
|
UpdateApp
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
DeployApp
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
ParseArgs()
|
||||||
|
{
|
||||||
|
if [ $# -eq 4 ];then
|
||||||
|
RunApp "$3"
|
||||||
|
elif [ -f "$5" ];then
|
||||||
|
if [ -n "$MIME_EXEC" ];then
|
||||||
|
RunApp "$MIME_EXEC" "$(UnixUriToDosPath "$5")" "${@:6}"
|
||||||
|
else
|
||||||
|
RunApp "$3" "$(UnixUriToDosPath "$5")" "${@:6}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
RunApp "$3" "${@:5}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#init_log_file
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#####准备启动进程,分析在 https://blog.shenmo.tech/post/deepin-wine6%E7%9A%84run_v4%E8%84%9A%E6%9C%AC%E6%8E%A2%E7%B4%A2%E5%90%AF%E5%8A%A8%E6%96%B9%E5%BC%8F/
|
||||||
|
if [ $# -lt 3 ]; then
|
||||||
|
debug_log "参数个数小于3个"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
|
||||||
|
if [ -f "$APPDIR/files.md5sum" ];then
|
||||||
|
APPVER="$(cat $APPDIR/files.md5sum)"
|
||||||
|
else
|
||||||
|
APPVER="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug_log "Run $*"
|
||||||
|
|
||||||
|
|
||||||
|
#执行lnk文件通过判断第5个参数是否是“/Unix”来判断
|
||||||
|
if [ "$4" == "/Unix" ];then
|
||||||
|
RunApp "$3" "$4" "$5"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $# -lt 4 ]; then
|
||||||
|
RunApp "$3"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
case $4 in
|
||||||
|
"-r" | "--reset")
|
||||||
|
ResetApp
|
||||||
|
;;
|
||||||
|
"-cb" | "--create")
|
||||||
|
CreateBottle
|
||||||
|
;;
|
||||||
|
"-e" | "--remove")
|
||||||
|
RemoveApp
|
||||||
|
;;
|
||||||
|
"-u" | "--uri")
|
||||||
|
ParseArgs "$@"
|
||||||
|
;;
|
||||||
|
"-f" | "--file")
|
||||||
|
ParseArgs "$@"
|
||||||
|
;;
|
||||||
|
"-h" | "--help")
|
||||||
|
HelpApp
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option: $4"
|
||||||
|
echo "Use -h|--help to get help"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
22
helper/spark_run_v4_app_configs/Deepin-CS6.sh
Normal file
22
helper/spark_run_v4_app_configs/Deepin-CS6.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#get file full path
|
||||||
|
path="$1"
|
||||||
|
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
|
||||||
|
path=$(echo ${path//\\/\/})
|
||||||
|
|
||||||
|
#kill bloack process
|
||||||
|
name="${path##*/}"
|
||||||
|
$SHELL_DIR/spark_kill.sh "$name" block
|
||||||
|
|
||||||
|
#change current dir to excute path
|
||||||
|
path=$(dirname "$path")
|
||||||
|
cd "$path"
|
||||||
|
pwd
|
||||||
|
|
||||||
|
#Set default mime type
|
||||||
|
if [ -n "$MIME_TYPE" ]; then
|
||||||
|
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug_log_to_file "Starting process $* ..."
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
4
helper/spark_run_v4_app_configs/Deepin-Dding.sh
Normal file
4
helper/spark_run_v4_app_configs/Deepin-Dding.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
debug_log "run $1"
|
||||||
|
$SHELL_DIR/spark_kill.sh DingTalk block
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
9
helper/spark_run_v4_app_configs/Deepin-Evernote.sh
Normal file
9
helper/spark_run_v4_app_configs/Deepin-Evernote.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#set -- "$1" "${2#file://*}"
|
||||||
|
local path=$(urldecode "$2")
|
||||||
|
path=${path/file:\/\//}
|
||||||
|
set -- "$1" "$path"
|
||||||
|
if [ "$path" ];then
|
||||||
|
CallProcess "$@"
|
||||||
|
else
|
||||||
|
CallProcess "$1"
|
||||||
|
fi
|
||||||
9
helper/spark_run_v4_app_configs/Deepin-FastReadPDF.sh
Normal file
9
helper/spark_run_v4_app_configs/Deepin-FastReadPDF.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#set -- "$1" "${2#file://*}"
|
||||||
|
local path=$(urldecode "$2")
|
||||||
|
path=${path/file:\/\//}
|
||||||
|
set -- "$1" "$path"
|
||||||
|
if [ "$path" ];then
|
||||||
|
CallProcess "$@"
|
||||||
|
else
|
||||||
|
CallProcess "$1"
|
||||||
|
fi
|
||||||
2
helper/spark_run_v4_app_configs/Deepin-Foxmail.sh
Normal file
2
helper/spark_run_v4_app_configs/Deepin-Foxmail.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
sed -i '/LogPixels/d' ${WINEPREFIX}/user.reg
|
||||||
|
CallProcess "$@"
|
||||||
9
helper/spark_run_v4_app_configs/Deepin-MTXX.sh
Normal file
9
helper/spark_run_v4_app_configs/Deepin-MTXX.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#set -- "$1" "${2#file://*}"
|
||||||
|
local path=$(urldecode "$2")
|
||||||
|
path=${path/file:\/\//}
|
||||||
|
set -- "$1" "$path"
|
||||||
|
if [ "$path" ];then
|
||||||
|
CallProcess "$@"
|
||||||
|
else
|
||||||
|
CallProcess "$1"
|
||||||
|
fi
|
||||||
1
helper/spark_run_v4_app_configs/Deepin-QQ-Spark.sh
Symbolic link
1
helper/spark_run_v4_app_configs/Deepin-QQ-Spark.sh
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
Deepin-QQ.sh
|
||||||
25
helper/spark_run_v4_app_configs/Deepin-QQ.sh
Normal file
25
helper/spark_run_v4_app_configs/Deepin-QQ.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
|
||||||
|
debug_log "first run time"
|
||||||
|
$SHELL_DIR/add_hotkeys
|
||||||
|
$SHELL_DIR/fontconfig
|
||||||
|
touch "$WINEPREFIX/../.QQ_run"
|
||||||
|
fi
|
||||||
|
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQ/Bin/QQLiveMPlayer"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQ/Bin/QQLiveMPlayer1"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QzoneMusic"
|
||||||
|
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQBrowser"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/QQBrowser"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQBrowserBin"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQBrowserDefault"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/QQBrowserDefault"
|
||||||
|
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQPCMgr"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/QQPCMgr"
|
||||||
|
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/HuaYang"
|
||||||
|
DisableWrite "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/HuaYang"
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
3
helper/spark_run_v4_app_configs/Deepin-QQBydr.sh
Normal file
3
helper/spark_run_v4_app_configs/Deepin-QQBydr.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
debug_log "run $1"
|
||||||
|
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||||
|
CallProcess "$1" -action:force_download -appid:1104632801 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||||
4
helper/spark_run_v4_app_configs/Deepin-QQGame.sh
Normal file
4
helper/spark_run_v4_app_configs/Deepin-QQGame.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
debug_log "run $1"
|
||||||
|
$SHELL_DIR/spark_kill.sh qqgame block
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
|
||||||
3
helper/spark_run_v4_app_configs/Deepin-QQHlddz.sh
Normal file
3
helper/spark_run_v4_app_configs/Deepin-QQHlddz.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
debug_log "run $1"
|
||||||
|
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||||
|
CallProcess "$1" -action:force_download -appid:363 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||||
3
helper/spark_run_v4_app_configs/Deepin-QQMnsj.sh
Normal file
3
helper/spark_run_v4_app_configs/Deepin-QQMnsj.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
debug_log "run $1"
|
||||||
|
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||||
|
CallProcess "$1" -action:force_download -appid:1105856612 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||||
3
helper/spark_run_v4_app_configs/Deepin-QQSszb.sh
Normal file
3
helper/spark_run_v4_app_configs/Deepin-QQSszb.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
debug_log "run $1"
|
||||||
|
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
|
||||||
|
CallProcess "$1" -action:force_download -appid:1105640244 -pid:8 -bin_version:1.1.2.4 -loginuin:
|
||||||
23
helper/spark_run_v4_app_configs/Deepin-THS.sh
Normal file
23
helper/spark_run_v4_app_configs/Deepin-THS.sh
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
$SHELL_DIR/spark_kill.sh ths block
|
||||||
|
|
||||||
|
debug_log "Start run $1"
|
||||||
|
#get file full path
|
||||||
|
path="$1"
|
||||||
|
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
|
||||||
|
path=$(echo ${path//\\/\/})
|
||||||
|
|
||||||
|
#kill bloack process
|
||||||
|
name="${path##*/}"
|
||||||
|
$SHELL_DIR/spark_kill.sh "$name" block
|
||||||
|
|
||||||
|
#change current dir to excute path
|
||||||
|
path=$(dirname "$path")
|
||||||
|
cd "$path"
|
||||||
|
pwd
|
||||||
|
|
||||||
|
#Set default mime type
|
||||||
|
if [ -n "$MIME_TYPE" ]; then
|
||||||
|
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
17
helper/spark_run_v4_app_configs/Deepin-TIM.sh
Normal file
17
helper/spark_run_v4_app_configs/Deepin-TIM.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
|
||||||
|
debug_log "first run time"
|
||||||
|
$SHELL_DIR/add_hotkeys
|
||||||
|
####似乎是给dde-control-center添加快捷键
|
||||||
|
$SHELL_DIR/fontconfig
|
||||||
|
####暂时无法得知用途和用法
|
||||||
|
# If the bottle not exists, run reg may cost lots of times
|
||||||
|
# So create the bottle befor run reg
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD uninstaller --list
|
||||||
|
touch $WINEPREFIX/../.QQ_run
|
||||||
|
fi
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
|
|
||||||
|
#disable Tencent MiniBrowser
|
||||||
|
_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser"
|
||||||
5
helper/spark_run_v4_app_configs/Deepin-TencentVideo.sh
Normal file
5
helper/spark_run_v4_app_configs/Deepin-TencentVideo.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if [ -f "${WINEPREFIX}/drive_c/Program Files/Tencent/QQLive/Upgrade.dll" ]; then
|
||||||
|
rm -rf "${WINEPREFIX}/drive_c/Program Files/Tencent/QQLive/Upgrade.dll"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
9
helper/spark_run_v4_app_configs/Deepin-WXWork.sh
Normal file
9
helper/spark_run_v4_app_configs/Deepin-WXWork.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
if [ -d "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/Update" ]; then
|
||||||
|
rm -rf "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/Update"
|
||||||
|
fi
|
||||||
|
if [ -d "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/upgrade" ]; then
|
||||||
|
rm -rf "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/upgrade"
|
||||||
|
fi
|
||||||
|
#Support use native file dialog
|
||||||
|
|
||||||
|
CallProcess "$@"
|
||||||
9
helper/spark_run_v4_app_configs/Deepin-WangWang.sh
Normal file
9
helper/spark_run_v4_app_configs/Deepin-WangWang.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#/bin/bash
|
||||||
|
chmod 700 "$WINEPREFIX/drive_c/Program Files/AliWangWang/9.12.10C/wwbizsrv.exe"
|
||||||
|
chmod 700 "$WINEPREFIX/drive_c/Program Files/Alibaba/wwbizsrv/wwbizsrv.exe"
|
||||||
|
if [ $# = 3 ] && [ -z "$3" ];then
|
||||||
|
EXEC_PATH="c:/Program Files/AliWangWang/9.12.10C/WWCmd.exe"
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$EXEC_PATH" "$2" &
|
||||||
|
else
|
||||||
|
CallProcess "$@"
|
||||||
|
fi
|
||||||
2
helper/spark_run_v4_app_configs/Deepin-WeChat.sh
Normal file
2
helper/spark_run_v4_app_configs/Deepin-WeChat.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export DISABLE_RENDER_CLIPBOARD=1
|
||||||
|
CallProcess "$@"
|
||||||
18
helper/spark_run_v4_app_configs/Deepin-ZhuMu.sh
Normal file
18
helper/spark_run_v4_app_configs/Deepin-ZhuMu.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#change current dir to excute path
|
||||||
|
path=$(dirname "$path")
|
||||||
|
cd "$path"
|
||||||
|
pwd
|
||||||
|
|
||||||
|
#Set default mime type
|
||||||
|
if [ -n "$MIME_TYPE" ]; then
|
||||||
|
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug_log_to_file "Starting process $* ..."
|
||||||
|
if [ -n "$2" ];then
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" "--url=$2" &
|
||||||
|
else
|
||||||
|
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
|
||||||
|
fi
|
||||||
3
helper/spark_run_v4_app_configs/IE8.sh
Normal file
3
helper/spark_run_v4_app_configs/IE8.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
rm -f "$WINEPREFIX/system.reg"
|
||||||
|
cp $APPDIR/system.reg "$WINEPREFIX/system.reg"
|
||||||
|
CallProcess "$@"
|
||||||
4
helper/spark_run_v4_app_configs/Spark-CloudMusic.sh
Normal file
4
helper/spark_run_v4_app_configs/Spark-CloudMusic.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CallProcess "$@"
|
||||||
|
sleep 2
|
||||||
|
/opt/apps/com.163.music.spark/files/disable_cloudmusic_shadows
|
||||||
3
helper/spark_run_v4_app_configs/Spark-MailMaster.sh
Normal file
3
helper/spark_run_v4_app_configs/Spark-MailMaster.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
CallProcess "$@"
|
||||||
|
sleep 2
|
||||||
|
/opt/apps/com.163.dashi.mailmaster.spark/files/disable_mailmaster_shadows
|
||||||
4
helper/spark_run_v4_app_configs/Spark-MuBu.sh
Normal file
4
helper/spark_run_v4_app_configs/Spark-MuBu.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
if [ -f "${WINEPREFIX}/drive_c/ProgramData/Microsoft/Windows/Start\ Menu/Programs/MuBu.lnk" ]; then
|
||||||
|
chmod 555 ${WINEPREFIX}/drive_c/ProgramData/Microsoft/Windows/Start\ Menu/Programs/MuBu.lnk
|
||||||
|
fi
|
||||||
|
CallProcess "$@"
|
||||||
1
helper/spark_run_v4_app_configs/Spark-QQ.sh
Symbolic link
1
helper/spark_run_v4_app_configs/Spark-QQ.sh
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
Deepin-QQ.sh
|
||||||
16
helper/spark_run_v4_app_configs/Spark-QQMusic.sh
Normal file
16
helper/spark_run_v4_app_configs/Spark-QQMusic.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if [ -e ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/QQMusic.exe ]; then
|
||||||
|
sleep 1
|
||||||
|
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.log
|
||||||
|
else
|
||||||
|
mkdir ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||||
|
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.dll ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||||
|
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.exe ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||||
|
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.rdb ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||||
|
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.log ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||||
|
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/QQMusic* ${WINEPREFIX}/drive_c/Program\ Files/Tencent
|
||||||
|
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic
|
||||||
|
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
|
||||||
|
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/*.log
|
||||||
|
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic* ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic
|
||||||
|
fi
|
||||||
|
CallProcess "$@"
|
||||||
1
helper/spark_run_v4_app_configs/Spark-TIM.sh
Symbolic link
1
helper/spark_run_v4_app_configs/Spark-TIM.sh
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
Deepin-TIM.sh
|
||||||
1
helper/spark_run_v4_app_configs/Spark-WeCom.sh
Symbolic link
1
helper/spark_run_v4_app_configs/Spark-WeCom.sh
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
Deepin-WXWork.sh
|
||||||
6
helper/spark_run_v4_app_configs/Spark-douyin.sh
Normal file
6
helper/spark_run_v4_app_configs/Spark-douyin.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
if [ -f "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin" ]; then
|
||||||
|
rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin"
|
||||||
|
mv ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/*.tmp ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/douyin
|
||||||
|
chmod 755 ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/douyin
|
||||||
|
fi
|
||||||
|
CallProcess "$@"
|
||||||
2
helper/spark_run_v4_app_configs/Spark-ecloud.sh
Normal file
2
helper/spark_run_v4_app_configs/Spark-ecloud.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DisableWrite ${WINEPREFIX}/drive_c/users/${USER}/Temp
|
||||||
|
CallProcess "$@"
|
||||||
5
helper/spark_run_v4_app_configs/Spark-flyele.sh
Normal file
5
helper/spark_run_v4_app_configs/Spark-flyele.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if [ -w ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports ]; then
|
||||||
|
rm -rf ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports/*
|
||||||
|
chmod 555 ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports
|
||||||
|
fi
|
||||||
|
CallProcess "$@"
|
||||||
37
helper/spark_run_v4_app_configs/Spark-weixin.sh
Normal file
37
helper/spark_run_v4_app_configs/Spark-weixin.sh
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
echo
|
||||||
|
echo "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⡟⠉⠻⣷⡄⠀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣴⣶⣶⣿⣿⡄⠀⠀⢀⣤⣾⠿⠻⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣤⣾⣿⣏⡁⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡿⢿⣿⣯⣀⣿⣿⡿⢿⣿⣿⣿⣿⣿⣷⣄⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣶⣬⡙⠿⠋⣡⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠈⢻⣿⣿⠟⣁⣴⣤⡙⠻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠺⢿⣿⣿⣿⢿⠇⠀⠀⠀⠀⠀⠀⠹⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⣖⣆⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⣿⠟⠛⠛⠛⠛⠛⠛⠛⠷⠿⠿⢿⣷⣶⣤⣤⣀⣸⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠛⢻⡏⠁⣈⢻⠙⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⣲⡟⠞⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⣿⡇⠀⠀⠀⠀⢀⣀⣀⣤⣤⣤⣤⣤⣶⣶⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⣿⣷⣶⣾⡿⠿⠿⠛⢛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣠⡤⣀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠙⠋⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⢠⣾⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⣥⣼⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠸⠽⠻⣿⡿⠟⠁⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣁⣼⣿⣿⣿⣿⣿⢻⣿⡀⠙⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⣀⣤⣤⣄⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣶⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⢿⣿⣿⣿⠇⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠉⠉⠁⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠾⣿⣿⣿⣿⣿⣿⣿⡿⠷⣬⡻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⢘⣿⣿⣿⣿⣿⠏⠀⠀⣀⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠈⠙⢿⣿⣷⣾⣿⠿⣿⣿⣇⣤⣶⣿⣿⠿⠛⠋⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠉⠻⣿⣿⣿⣿⣷⠀⠀⣠⣶⣿⠿⠉⠁⠀⠀⠀⠉⠉⠉⠻⣿⣷⣄⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣤⣤⣤⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣷⠿⡿⠋⠀⠀⠀⠀⣄⢀⣀⠀⠀⠀⠀⠀⠙⢿⣷⣄⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠀⠀⠀⠀⠀
|
||||||
|
⣀⣀⠀⠀⠀⠀⢀⣴⣿⣿⠛⠀⠀⢸⣧⡿⠀⠀⣸⠋⠋⠉⢻⡄⠀⠀⠀⠀⠀⠉⢁⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠈⠀⠀⠀⢻⣀⣀⣀⣀⡿⠀⠀⠀⠀⠀⠀⠀⢉⣭⣭⣽⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⣀⣤⡄
|
||||||
|
⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⣀⠀⠀⠀⠉⠀⠀⠉⠀⠀⠀⠀⠀⢀⣀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃
|
||||||
|
⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⣿⣿⣿⣿⣶⣶⡶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀
|
||||||
|
⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⢿⡸⣿⣿⣿⣿⣎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀
|
||||||
|
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣽⣿⣿⡟⠁⠀⢙⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠉⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣦⣶⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠘⣿⣿⡿⠟⠉⢿⣯⣿⣿⣿⠁⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⡇⠀⠀⢸⡟⠋⠀⠀⠀⠀⠙⠛⠋⢸⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⢻⣿⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⡆⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
||||||
|
|
||||||
|
echo "以此纪念2.4.0版本"
|
||||||
|
CallProcess "$@"
|
||||||
1
helper/spark_run_v4_app_configs/Wine-QQ.sh
Symbolic link
1
helper/spark_run_v4_app_configs/Wine-QQ.sh
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
Deepin-QQ.sh
|
||||||
1
helper/spark_run_v4_app_configs/wxwork-spark-uk.sh
Symbolic link
1
helper/spark_run_v4_app_configs/wxwork-spark-uk.sh
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
Deepin-WXWork.sh
|
||||||
42
helper/spark_updater
Executable file
42
helper/spark_updater
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 检查是否提供了-c和-s选项
|
||||||
|
if [[ ! "$*" =~ "-c" ]] || [[ ! "$*" =~ "-s" ]]; then
|
||||||
|
echo "用法: updater -c <目标目录> -s <源目录> [-v]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 解析命令行参数
|
||||||
|
while getopts ":c:s:v" opt; do
|
||||||
|
case $opt in
|
||||||
|
c)
|
||||||
|
destination_dir=$OPTARG
|
||||||
|
;;
|
||||||
|
s)
|
||||||
|
source_dir=$OPTARG
|
||||||
|
;;
|
||||||
|
v)
|
||||||
|
verbose=true
|
||||||
|
;;
|
||||||
|
\?)
|
||||||
|
echo "无效选项: -$OPTARG" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
:)
|
||||||
|
echo "选项 -$OPTARG 需要一个参数." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# 从源目录复制文件到目标目录
|
||||||
|
if [ "$verbose" = true ]; then
|
||||||
|
echo "正在从 $source_dir 复制文件到 $destination_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 使用cp命令覆盖同名文件
|
||||||
|
cp -rf "$source_dir"/* "$destination_dir"
|
||||||
|
|
||||||
|
echo "文件复制完成!"
|
||||||
|
exit 0
|
||||||
|
|
||||||
3
helper/transhell/spark_run_v4.sh_en_US.transhell
Normal file
3
helper/transhell/spark_run_v4.sh_en_US.transhell
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
TRANSHELL_CONTENT_UNPACKING="Preparing the following APP:"
|
||||||
|
TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL="Spark Windows APP Compatibility Helper"
|
||||||
4
helper/transhell/spark_run_v4.sh_zh_CN.transhell
Normal file
4
helper/transhell/spark_run_v4.sh_zh_CN.transhell
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
TRANSHELL_CONTENT_UNPACKING="正在为您准备以下应用:"
|
||||||
|
TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL="星火Windows应用兼容助手"
|
||||||
|
|
||||||
Reference in New Issue
Block a user