新增开启VNC公共访问选项

This commit is contained in:
gfdgd xi 2024-07-21 19:30:03 +08:00
parent 1bdf8de39c
commit 55aeae22af

@ -3,16 +3,22 @@ CURRENT_DIR=$(dirname $(readlink -f "$0"))
if [[ ! -d $TMPDIR/tmp ]]; then if [[ ! -d $TMPDIR/tmp ]]; then
mkdir -p $TMPDIR/tmp mkdir -p $TMPDIR/tmp
fi fi
noVNCOption="--vnc localhost:5901"
VNCServerOption="-localhost yes"
if [[ -f $HOME/.config/deepin-wine-runner/vnc-public ]]; then
unset noVNCOption
unset VNCServerOption
fi
if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]]; then if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]]; then
# 自动配置 NoVNC # 自动配置 NoVNC
export DISPLAY=:5 export DISPLAY=:5
vncserver -kill :5 vncserver -kill :5
vncserver $DISPLAY & vncserver $DISPLAY $VNCServerOption &
sleep 3 sleep 3
xfwm4 & xfwm4 &
if [[ -f /data/data/com.termux/files/usr/bin/startxfce4 ]]; then if [[ -f /data/data/com.termux/files/usr/bin/startxfce4 ]]; then
startxfce4 & startxfce4 &
fi fi
$CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 & $CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 $noVNCOption &
fi fi
python3 $CURRENT_DIR/mainwindow.py python3 $CURRENT_DIR/mainwindow.py