deep-wine-runner/mainwindow-termux-loader.sh

25 lines
804 B
Bash
Raw Normal View History

2024-07-21 11:34:44 +08:00
#!/data/data/com.termux/files/usr/bin/bash
2024-07-21 12:44:10 +08:00
CURRENT_DIR=$(dirname $(readlink -f "$0"))
2024-07-21 13:11:39 +08:00
if [[ ! -d $TMPDIR/tmp ]]; then
mkdir -p $TMPDIR/tmp
fi
2024-07-24 12:49:37 +08:00
noVNCOption="--listen localhost:6080"
2024-07-21 19:30:03 +08:00
VNCServerOption="-localhost yes"
if [[ -f $HOME/.config/deepin-wine-runner/vnc-public ]]; then
unset noVNCOption
unset VNCServerOption
fi
if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]] && [[ -f /data/data/com.termux/files/usr/bin/vncpasswd ]]; then
2024-07-21 11:34:44 +08:00
# 自动配置 NoVNC
export DISPLAY=:5
2024-07-21 17:49:45 +08:00
vncserver -kill :5
2024-07-21 19:30:03 +08:00
vncserver $DISPLAY $VNCServerOption &
2024-07-21 11:34:44 +08:00
sleep 3
xfwm4 &
if [[ -f /data/data/com.termux/files/usr/bin/startxfce4 ]]; then
startxfce4 &
fi
2024-07-21 19:30:03 +08:00
$CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 $noVNCOption &
2024-07-21 11:34:44 +08:00
fi
python3 $CURRENT_DIR/mainwindow.py