mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2026-06-22 14:13:52 +08:00
不再又臭又长
This commit is contained in:
@@ -2,6 +2,6 @@
|
|||||||
if [ ! -d /opt/deepinwine/tools ];then
|
if [ ! -d /opt/deepinwine/tools ];then
|
||||||
mkdir -p /opt/deepinwine/tools
|
mkdir -p /opt/deepinwine/tools
|
||||||
fi
|
fi
|
||||||
if [ ! -e /opt/deepinwine/tools/spark_run_v4.sh ];then
|
|
||||||
ln -sv /opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark_run_v4.sh /opt/deepinwine/tools/spark_run_v4.sh
|
ln -svf /opt/spark-dwine-helper/spark_run_v4.sh /opt/deepinwine/tools/spark_run_v4.sh
|
||||||
fi
|
ln -svf /opt/spark-dwine-helper/spark_kill.sh /opt/deepinwine/tools/spark_kill.sh
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -e /opt/deepinwine/tools/spark_run_v4.sh ];then
|
|
||||||
unlink /opt/deepinwine/tools/spark_run_v4.sh
|
unlink /opt/deepinwine/tools/spark_run_v4.sh
|
||||||
fi
|
unlink /opt/deepinwine/tools/spark_kill.sh
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Categories=Utility;
|
|
||||||
Encoding=UTF-8
|
|
||||||
Exec=bash -c "/opt/apps/store.spark-app.spark-dwine-helper/files/deepinwine/tools/spark-dwine-helper/wine-app-launcher/settings.sh"
|
|
||||||
Icon=store.spark-app.spark-dwine-helper
|
|
||||||
MimeType=
|
|
||||||
Name=Spark Wine App Launcher
|
|
||||||
Name[zh_CN]=星火Wine应用启动器
|
|
||||||
StartupWMClass=store.spark-app.spark-dwine-helper
|
|
||||||
Terminal=False
|
|
||||||
Type=Application
|
|
||||||
NoDisplay=false
|
|
||||||
X-Deepin-Vendor=user-custom
|
|
||||||
-39
@@ -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" $@; }
|
|
||||||
|
|
||||||
-38
@@ -1,38 +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 "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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Get_Dist_Name
|
|
||||||
## 1. If WINEPREFIX is not set, use ~/.wine
|
|
||||||
if [ "$WINEPREFIX" = "" ];then
|
|
||||||
export WINEPREFIX=$HOME/.wine
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ]&& [ "$DISTRO" != "GXDE" ];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
|
|
||||||
|
|
||||||
-39
@@ -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" $@; }
|
|
||||||
|
|
||||||
+5
@@ -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"; }
|
||||||
|
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 195 KiB |
+6
-4
@@ -9,13 +9,15 @@ Get_Dist_Name()
|
|||||||
DISTRO='Deepin'
|
DISTRO='Deepin'
|
||||||
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
|
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
|
||||||
DISTRO='UniontechOS'
|
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
|
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
|
||||||
DISTRO='UniontechOS'
|
DISTRO='UniontechOS'
|
||||||
else
|
else
|
||||||
DISTRO='OtherOS'
|
DISTRO='OtherOS'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
#########<<<<<<<
|
######<<<<<<<
|
||||||
|
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
echo "无参数,无法启动。这是一个set-wine-scale的组件,一般来说,你不会需要单独启动这个脚本"
|
echo "无参数,无法启动。这是一个set-wine-scale的组件,一般来说,你不会需要单独启动这个脚本"
|
||||||
@@ -47,7 +49,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
Get_Dist_Name
|
Get_Dist_Name
|
||||||
if [ "$DISTRO" = "UniontechOS" ];then
|
if [ "$DISTRO" = "UniontechOS" ] || [ "$DISTRO" = "GXDE" ];then
|
||||||
echo 1.0 > $HOME/.config/spark-wine/scale.txt
|
echo 1.0 > $HOME/.config/spark-wine/scale.txt
|
||||||
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
|
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
|
||||||
#####就是1倍缩放
|
#####就是1倍缩放
|
||||||
-8
@@ -67,14 +67,6 @@ if [ $APPRUN_CMD ]; then
|
|||||||
WINE_CMD=$APPRUN_CMD
|
WINE_CMD=$APPRUN_CMD
|
||||||
fi
|
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
|
##################### Functions
|
||||||
progressbar()
|
progressbar()
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Categories=Utility;
|
||||||
|
Encoding=UTF-8
|
||||||
|
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/settings.sh"
|
||||||
|
Icon=spark-dwine-helper
|
||||||
|
MimeType=
|
||||||
|
Name=Spark Wine App Launcher
|
||||||
|
Name[zh_CN]=星火Wine应用启动器
|
||||||
|
StartupWMClass=spark-dwine-helper
|
||||||
|
Terminal=False
|
||||||
|
Type=Application
|
||||||
|
NoDisplay=false
|
||||||
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Reference in New Issue
Block a user