add: wine launcher

This commit is contained in:
2025-02-26 01:51:28 +08:00
parent 34eb09779e
commit 6c59b8378a
6 changed files with 77 additions and 10 deletions

View File

@@ -0,0 +1,48 @@
#!/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-wine <application.exe>\n\n请提供要运行的 Windows 应用程序。\nPlease provide the Windows application to run."
exit 1
fi
# Check if spark-wine is installed
if ! command -v spark-wine &>/dev/null; then
gui_dialog --question --text="您尚未安装 spark-wine ,是否安装以运行 Windows 应用?\nYou haven't installed spark-wine 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-wine spark-wine-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-wine spark-wine-mono -y"
exit 1
fi
fi
# Run spark-wine with WINEPREFIX
export WINEPREFIX="$HOME/.wine"
spark-wine "$@"

View File

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

View File

@@ -1,12 +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
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher %F"
Icon=spark-wine-launcher
MimeType=
Name=Launch Custom Windows App
Name[zh_CN]=启动自定义Windows应用
StartupWMClass=spark-dwine-helper
Name=Launch Windows App
Name[zh_CN]=启动Windows应用
StartupWMClass=spark-wine-launcher
Terminal=False
Type=Application
NoDisplay=false

View File

@@ -1,12 +1,12 @@
[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
Exec=bash -c "/opt/spark-dwine-helper/spark-dwine-helper/wine-app-launcher/spark-wine-launcher uninstaller"
Icon=spark-wine-uninstaller
MimeType=
Name=Uninstall Custom Windows App
Name[zh_CN]=卸载自定义Windows应用
StartupWMClass=spark-dwine-helper
Name=Uninstall Windows App
Name[zh_CN]=卸载Windows应用
StartupWMClass=spark-wine-uninstaller
Terminal=False
Type=Application
NoDisplay=false

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