优化在termux的使用体验

This commit is contained in:
2024-07-21 11:34:44 +08:00
parent 0b0a757765
commit 2357c646a1
5 changed files with 28 additions and 3 deletions

View File

@@ -146,7 +146,7 @@ copy-files:
cp -rv RemoveQemuUser.sh deb/opt/apps/deepin-wine-runner cp -rv RemoveQemuUser.sh deb/opt/apps/deepin-wine-runner
cp -rv InstallBox86.sh deb/opt/apps/deepin-wine-runner cp -rv InstallBox86.sh deb/opt/apps/deepin-wine-runner
cp -rv InstallRuntime deb/opt/apps/deepin-wine-runner cp -rv InstallRuntime deb/opt/apps/deepin-wine-runner
if [[ ! -d novnc/utils/websockify ]]; then ; git submodule update --init --recursive ; fi if [[ ! -d novnc/utils/websockify ]]; then git submodule update --init --recursive ; fi
cp -rv novnc deb/opt/apps/deepin-wine-runner cp -rv novnc deb/opt/apps/deepin-wine-runner
mkdir -pv deb/opt/apps/deepin-wine-runner/entries/ mkdir -pv deb/opt/apps/deepin-wine-runner/entries/
cp -rv deb/usr/share/applications deb/opt/apps/deepin-wine-runner/entries/applications cp -rv deb/usr/share/applications deb/opt/apps/deepin-wine-runner/entries/applications
@@ -212,6 +212,9 @@ package-termux-deb:
sudo cp deb-termux/DEBIAN /tmp/spark-deepin-wine-runner-builder/DEBIAN -rv sudo cp deb-termux/DEBIAN /tmp/spark-deepin-wine-runner-builder/DEBIAN -rv
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/entries/applications sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/entries/applications
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/share/applications sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/share/applications
# 加入 termux loader
sudo cp -rv mainwindow-termux-loader.sh /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner
sudo cp -rv mainwindow.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/mainwindow.py
sudo bash builddeb/ChangeDebVersion.sh sudo bash builddeb/ChangeDebVersion.sh
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-termux.deb dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-termux.deb
make remove-copy-files -j$(nproc) make remove-copy-files -j$(nproc)

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sys
import subprocess import subprocess
import PyQt5.QtWidgets as QtWidgets
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
arch = subprocess.getoutput("dpkg --print-architecture").replace(" ", "").replace("\n", "") arch = subprocess.getoutput("dpkg --print-architecture").replace(" ", "").replace("\n", "")
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"): if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
@@ -13,6 +15,10 @@ if not os.path.exists(f"{programPath}/VirtualMachine-amd64"):
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"): if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
os.system(f"{programPath}/VirtualMachine-{arch}") os.system(f"{programPath}/VirtualMachine-{arch}")
exit() exit()
app = QtWidgets.QApplication(sys.argv)
QtWidgets.QMessageBox.information(None, "提示", "虚拟机安装器暂不支持此系统")
exit(1)
# 后面已废弃
# 只能使用 Qemu User 运行程序 # 只能使用 Qemu User 运行程序
if os.path.exists("/usr/lib/x86_64-linux-gnu/") and not os.system("which qemu-x86_64"): if os.path.exists("/usr/lib/x86_64-linux-gnu/") and not os.system("which qemu-x86_64"):
os.system(f"qemu-x86_64 '{programPath}/VirtualMachine-x86_64'") os.system(f"qemu-x86_64 '{programPath}/VirtualMachine-x86_64'")

View File

@@ -26,7 +26,8 @@ Depends: python3,
git, git,
xfwm4, xfwm4,
tigervnc, tigervnc,
proot proot,
bash
Recommends: winbind, Recommends: winbind,
wimtools | wimlib, wimtools | wimlib,
python3-pyquery, python3-pyquery,

View File

@@ -27,7 +27,8 @@ Depends: python3,
zenity, zenity,
tree, tree,
dpkg, dpkg,
fakeroot fakeroot,
bash
Recommends: winbind, Recommends: winbind,
wimtools | wimlib, wimtools | wimlib,
python3-pyquery, python3-pyquery,

14
mainwindow-termux-loader.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/data/data/com.termux/files/usr/bin/bash
CURRENT_DIR=$(cd $(dirname $0); pwd)
if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]]; then
# 自动配置 NoVNC
export DISPLAY=:5
vncserver $DISPLAY &
sleep 3
xfwm4 &
if [[ -f /data/data/com.termux/files/usr/bin/startxfce4 ]]; then
startxfce4 &
fi
$CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 &
fi
python3 $CURRENT_DIR/mainwindow.py