From 54b3d11431c17419bbc7c998fbc7acdfdb05e276 Mon Sep 17 00:00:00 2001 From: Caten Date: Tue, 17 Dec 2024 21:37:49 +0800 Subject: [PATCH] support vnc and fix wps --- lib/main.dart | 16 +++++----------- lib/workflow.dart | 4 ++-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 039d782..4e32229 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -383,17 +383,11 @@ sed -i -E "s@^(VNC_RESOLUTION)=.*@\\1=${w}x${h}@" \$(command -v startvnc)"""); ]), const SizedBox.square(dimension: 8), SwitchListTile(title: const Text("默认使用Termux X11"), subtitle: const Text("不使用VNC。重启生效"), value: Util.getGlobal("useX11") as bool, onChanged:(value) { - if (!context.mounted) return; - ScaffoldMessenger.of(context).hideCurrentSnackBar(); - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text("GXDE版本暂未适配VNC")) - ); - return; - // G.prefs.setBool("useX11", value); - // if (!value && Util.getGlobal("dri3")) { - // G.prefs.setBool("dri3", false); - // } - // setState(() {}); + G.prefs.setBool("useX11", value); + if (!value && Util.getGlobal("dri3")) { + G.prefs.setBool("dri3", false); + } + setState(() {}); },), const SizedBox.square(dimension: 16), const Divider(height: 2, indent: 8, endIndent: 8), diff --git a/lib/workflow.dart b/lib/workflow.dart index b97a406..d7d8935 100644 --- a/lib/workflow.dart +++ b/lib/workflow.dart @@ -117,7 +117,7 @@ class Util { case "isHidpiEnabled" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false); case "isJpEnabled" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false); case "useAvnc" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(true); - case "useX11" : return true; // b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false); + case "useX11" : return b ? G.prefs.getBool(key)! : (value){G.prefs.setBool(key, value); return value;}(false); case "defaultFFmpegCommand" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("-hide_banner -an -max_delay 1000000 -r 30 -f android_camera -camera_index 0 -i 0:0 -vf scale=iw/2:-1 -rtsp_transport udp -f rtsp rtsp://127.0.0.1:8554/stream"); case "defaultVirglCommand" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("--socket-path=\$CONTAINER_DIR/tmp/.virgl_test"); case "defaultVirglOpt" : return b ? G.prefs.getString(key)! : (value){G.prefs.setString(key, value); return value;}("GALLIUM_DRIVER=virpipe"); @@ -393,7 +393,7 @@ VSCode、输入法 {"name":"卸载Kdenlive", "command":"sudo apt autoremove --purge -y kdenlive"}, {"name":"安装科学计算软件Octave", "command":"sudo apt update && sudo apt install -y octave"}, {"name":"卸载Octave", "command":"sudo apt autoremove --purge -y octave"}, - {"name":"安装WPS", "command":r"""sudo dpkg --configure -a && sudo apt update && sudo aptss install -y wps-office"""}, + {"name":"安装WPS", "command":r"""sudo dpkg --configure -a && sudo aptss update && sudo aptss install -y wps-office"""}, {"name":"卸载WPS", "command":"sudo apt autoremove --purge -y wps-office"}, {"name":"安装CAJViewer", "command":"wget https://download.cnki.net/net.cnki.cajviewer_1.3.20-1_arm64.deb -O /tmp/caj.deb && sudo apt update && sudo apt install -y /tmp/caj.deb && bash /home/tiny/.local/share/tiny/caj/postinst; rm /tmp/caj.deb"}, {"name":"卸载CAJViewer", "command":"sudo apt autoremove --purge -y net.cnki.cajviewer && bash /home/tiny/.local/share/tiny/caj/postrm"},