From 91ccb3045ce0161370d25008eeec6ef5cabb9d81 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Thu, 20 Mar 2025 03:23:14 +0800 Subject: [PATCH] feat: implement lightweight mode functionality and update related settings --- src-tauri/src/cmd/lighteweight.rs | 15 +++++++ src-tauri/src/cmd/mod.rs | 2 + src-tauri/src/config/verge.rs | 7 ---- src-tauri/src/core/handle.rs | 12 ------ src-tauri/src/core/hotkey.rs | 8 ++-- src-tauri/src/feat/config.rs | 11 ----- src-tauri/src/lib.rs | 38 ++---------------- src-tauri/src/module/lightweight.rs | 25 ++++++++++++ src-tauri/src/module/mod.rs | 1 + .../setting/mods/lite-mode-viewer.tsx | 40 ++++++++----------- .../setting/setting-verge-advanced.tsx | 4 +- src/locales/ar.json | 4 +- src/locales/en.json | 16 ++++---- src/locales/fa.json | 4 +- src/locales/id.json | 4 +- src/locales/ru.json | 4 +- src/locales/tt.json | 4 +- src/locales/zh.json | 16 ++++---- src/pages/home.tsx | 6 +-- src/services/cmds.ts | 8 ++++ src/services/types.d.ts | 1 - 21 files changed, 104 insertions(+), 126 deletions(-) create mode 100644 src-tauri/src/cmd/lighteweight.rs create mode 100644 src-tauri/src/module/lightweight.rs diff --git a/src-tauri/src/cmd/lighteweight.rs b/src-tauri/src/cmd/lighteweight.rs new file mode 100644 index 00000000..7afbe0ef --- /dev/null +++ b/src-tauri/src/cmd/lighteweight.rs @@ -0,0 +1,15 @@ +use crate::module::lightweight; + +use super::CmdResult; + +#[tauri::command] +pub async fn entry_lightweight_mode() -> CmdResult { + lightweight::entry_lightweight_mode(); + Ok(()) +} + +#[tauri::command] +pub async fn exit_lightweight_mode() -> CmdResult { + lightweight::exit_lightweight_mode(); + Ok(()) +} diff --git a/src-tauri/src/cmd/mod.rs b/src-tauri/src/cmd/mod.rs index 7be1663c..61374546 100644 --- a/src-tauri/src/cmd/mod.rs +++ b/src-tauri/src/cmd/mod.rs @@ -17,6 +17,7 @@ pub mod uwp; pub mod validate; pub mod verge; pub mod webdav; +pub mod lighteweight; // Re-export all command functions for backwards compatibility pub use app::*; @@ -32,3 +33,4 @@ pub use uwp::*; pub use validate::*; pub use verge::*; pub use webdav::*; +pub use lighteweight::*; diff --git a/src-tauri/src/config/verge.rs b/src-tauri/src/config/verge.rs index f124365b..e22ca960 100644 --- a/src-tauri/src/config/verge.rs +++ b/src-tauri/src/config/verge.rs @@ -189,9 +189,6 @@ pub struct IVerge { pub enable_tray_speed: Option, - /// 轻量模式 - 只保留内核运行 - pub enable_lite_mode: Option, - /// 自动进入轻量模式 pub auto_enter_lite_mode: Option, @@ -299,7 +296,6 @@ impl IVerge { webdav_password: None, enable_tray_speed: Some(true), enable_global_hotkey: Some(true), - enable_lite_mode: Some(false), auto_enter_lite_mode: Some(false), auto_enter_lite_mode_delay: Some(10), enable_dns_settings: Some(true), @@ -385,7 +381,6 @@ impl IVerge { patch!(webdav_username); patch!(webdav_password); patch!(enable_tray_speed); - patch!(enable_lite_mode); patch!(auto_enter_lite_mode); patch!(auto_enter_lite_mode_delay); patch!(enable_dns_settings); @@ -478,7 +473,6 @@ pub struct IVergeResponse { pub webdav_username: Option, pub webdav_password: Option, pub enable_tray_speed: Option, - pub enable_lite_mode: Option, pub auto_enter_lite_mode: Option, pub auto_enter_lite_mode_delay: Option, pub enable_dns_settings: Option, @@ -545,7 +539,6 @@ impl From for IVergeResponse { webdav_username: verge.webdav_username, webdav_password: verge.webdav_password, enable_tray_speed: verge.enable_tray_speed, - enable_lite_mode: verge.enable_lite_mode, auto_enter_lite_mode: verge.auto_enter_lite_mode, auto_enter_lite_mode_delay: verge.auto_enter_lite_mode_delay, enable_dns_settings: verge.enable_dns_settings, diff --git a/src-tauri/src/core/handle.rs b/src-tauri/src/core/handle.rs index bef8c52f..4fabfaba 100644 --- a/src-tauri/src/core/handle.rs +++ b/src-tauri/src/core/handle.rs @@ -41,18 +41,6 @@ impl Handle { window } - pub fn destroy_window(&self) -> Result<(), String> { - if let Some(window) = self.get_window() { - log_err!(window.close()); - } - if let Some(window) = Self::global().get_window() { - if let Some(webview) = window.get_webview_window("main") { - log_err!(webview.destroy()); - } - } - Ok(()) - } - pub fn refresh_clash() { if let Some(window) = Self::global().get_window() { log_err!(window.emit("verge://refresh-clash-config", "yes")); diff --git a/src-tauri/src/core/hotkey.rs b/src-tauri/src/core/hotkey.rs index bef15409..ddf84108 100755 --- a/src-tauri/src/core/hotkey.rs +++ b/src-tauri/src/core/hotkey.rs @@ -176,15 +176,13 @@ impl Hotkey { println!("Executing function directly"); log::info!(target: "app", "Executing function directly"); - // 获取轻量模式状态和全局热键状态 - let is_lite_mode = Config::verge().latest().enable_lite_mode.unwrap_or(false); + // 获取全局热键状态 let is_enable_global_hotkey = Config::verge() .latest() .enable_global_hotkey .unwrap_or(true); - - // 在轻量模式下或配置了全局热键时,始终执行热键功能 - if is_lite_mode || is_enable_global_hotkey { + + if is_enable_global_hotkey { f(); } else if let Some(window) = app_handle.get_webview_window("main") { // 非轻量模式且未启用全局热键时,只在窗口可见且有焦点的情况下响应热键 diff --git a/src-tauri/src/feat/config.rs b/src-tauri/src/feat/config.rs index 88eb225b..6dd10789 100644 --- a/src-tauri/src/feat/config.rs +++ b/src-tauri/src/feat/config.rs @@ -2,7 +2,6 @@ use crate::{ config::{Config, IVerge}, core::{handle, hotkey, sysopt, tray, CoreManager}, log_err, - utils::resolve, }; use anyhow::Result; use serde_yaml::Mapping; @@ -68,7 +67,6 @@ pub async fn patch_verge(patch: IVerge, not_save_file: bool) -> Result<()> { let proxy_bypass = patch.system_proxy_bypass; let language = patch.language; let mixed_port = patch.verge_mixed_port; - let lite_mode = patch.enable_lite_mode; #[cfg(target_os = "macos")] let tray_icon = patch.tray_icon; #[cfg(not(target_os = "macos"))] @@ -192,15 +190,6 @@ pub async fn patch_verge(patch: IVerge, not_save_file: bool) -> Result<()> { tray::Tray::global().update_click_behavior()?; } - // Handle lite mode switch - if let Some(enable) = lite_mode { - if enable { - handle::Handle::global().destroy_window().ok(); - } else { - resolve::create_window(); - } - } - >::Ok(()) }; match res { diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 26f682b1..6124f0b7 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -215,6 +215,9 @@ pub fn run() { // media unlock checker cmd::get_unlock_items, cmd::check_media_unlock, + // light-weight model + cmd::entry_lightweight_mode, + cmd::exit_lightweight_mode, ]); #[cfg(debug_assertions)] @@ -283,41 +286,6 @@ pub fn run() { api.prevent_close(); let window = core::handle::Handle::global().get_window().unwrap(); let _ = window.hide(); - - // 检查是否启用了自动进入 Lite Mode - let verge = crate::config::Config::verge(); - let verge_config = verge.latest(); - let auto_enter_lite_mode = verge_config.auto_enter_lite_mode.unwrap_or(false); - - if auto_enter_lite_mode { - let delay_minutes = verge_config.auto_enter_lite_mode_delay.unwrap_or(10); - let app_handle_clone = app_handle.clone(); - println!("自动进入 Lite Mode 已启用"); - // 启动一个线程,在指定延迟后启用 Lite Mode - std::thread::spawn(move || { - println!("等待 {} 分钟后自动进入 Lite Mode", delay_minutes); - std::thread::sleep(std::time::Duration::from_secs(delay_minutes as u64 * 60)); - println!("Lite Mode 倒计时结束"); - - // 延迟后检查窗口是否仍然隐藏,如果是,则启用 Lite Mode - let window_opt = app_handle_clone.get_webview_window("main"); - if let Some(window) = window_opt { - if !window.is_visible().unwrap_or(true) { - println!("倒计时结束,正在进入 Lite Mode..."); - // 应用 Lite Mode - if let Err(e) = tauri::async_runtime::block_on(crate::feat::patch_verge( - crate::config::IVerge { - enable_lite_mode: Some(true), - ..Default::default() - }, - false - )) { - println!("Lite Mode 进入失败: {:?}", e); - } - } - } - }); - } } tauri::WindowEvent::Focused(true) => { #[cfg(target_os = "macos")] diff --git a/src-tauri/src/module/lightweight.rs b/src-tauri/src/module/lightweight.rs new file mode 100644 index 00000000..3c768acd --- /dev/null +++ b/src-tauri/src/module/lightweight.rs @@ -0,0 +1,25 @@ +use tauri::Manager; + +use crate::{core::handle, log_err, utils::resolve}; + + + +pub fn entry_lightweight_mode() { + println!("entry_lightweight_mode"); + log::debug!(target: "app", "entry_lightweight_mode"); + if let Some(window) = handle::Handle::global().get_window() { + log_err!(window.close()); + } + + if let Some(window) = handle::Handle::global().get_window() { + if let Some(webview) = window.get_webview_window("main") { + log_err!(webview.destroy()); + } + } +} + +pub fn exit_lightweight_mode() { + println!("exit_lightweight_mode"); + log::debug!(target: "app", "exit_lightweight_mode"); + resolve::create_window(); +} diff --git a/src-tauri/src/module/mod.rs b/src-tauri/src/module/mod.rs index c07cdce0..d122a47b 100644 --- a/src-tauri/src/module/mod.rs +++ b/src-tauri/src/module/mod.rs @@ -1,2 +1,3 @@ pub mod mihomo; pub mod sysinfo; +pub mod lightweight; \ No newline at end of file diff --git a/src/components/setting/mods/lite-mode-viewer.tsx b/src/components/setting/mods/lite-mode-viewer.tsx index 760c240f..d39bc990 100644 --- a/src/components/setting/mods/lite-mode-viewer.tsx +++ b/src/components/setting/mods/lite-mode-viewer.tsx @@ -12,6 +12,7 @@ import { import { useVerge } from "@/hooks/use-verge"; import { BaseDialog, DialogRef, Notice, Switch } from "@/components/base"; import { TooltipIcon } from "@/components/base/base-tooltip-icon"; +import { entry_lightweight_mode } from "@/services/cmds"; export const LiteModeViewer = forwardRef((props, ref) => { const { t } = useTranslation(); @@ -34,15 +35,6 @@ export const LiteModeViewer = forwardRef((props, ref) => { close: () => setOpen(false), })); - const onEnterLiteMode = useLockFn(async () => { - try { - await patchVerge({ enable_lite_mode: true }); - setOpen(false); - } catch (err: any) { - Notice.error(err.message || err.toString()); - } - }); - const onSave = useLockFn(async () => { try { await patchVerge({ @@ -58,7 +50,7 @@ export const LiteModeViewer = forwardRef((props, ref) => { return ( ((props, ref) => { > - - + entry_lightweight_mode()} > {t("Enable")} @@ -84,11 +76,11 @@ export const LiteModeViewer = forwardRef((props, ref) => { ((props, ref) => { {values.autoEnterLiteMode && ( <> - + ((props, ref) => { }} /> - + - {t("When closing the window, Lite Mode will be automatically activated after _n minutes", - { n: values.autoEnterLiteModeDelay })} + {t("When closing the window, LightWeight Mode will be automatically activated after _n minutes", + { n: values.autoEnterLiteModeDelay })} diff --git a/src/components/setting/setting-verge-advanced.tsx b/src/components/setting/setting-verge-advanced.tsx index af2bbf53..aee48d76 100644 --- a/src/components/setting/setting-verge-advanced.tsx +++ b/src/components/setting/setting-verge-advanced.tsx @@ -107,9 +107,9 @@ const SettingVergeAdvanced = ({ onError }: Props) => { + } onClick={() => liteModeRef.current?.open()} /> diff --git a/src/locales/ar.json b/src/locales/ar.json index 581dfec4..06543dd7 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -436,8 +436,8 @@ "Global Mode": "الوضع العالمي", "Direct Mode": "الوضع المباشر", "Enable Tray Speed": "تفعيل سرعة التراي", - "Lite Mode": "وضع الأداء الخفيف", - "Lite Mode Info": "إيقاف الواجهة الرسومية والإبقاء على تشغيل النواة", + "LightWeight Mode": "وضع الأداء الخفيف", + "LightWeight Mode Info": "إيقاف الواجهة الرسومية والإبقاء على تشغيل النواة", "Config Validation Failed": "فشل التحقق من تكوين الاشتراك، يرجى فحص ملف التكوين، تم التراجع عن التغييرات، تفاصيل الخطأ:", "Boot Config Validation Failed": "فشل التحقق من التكوين عند الإقلاع، تم استخدام التكوين الافتراضي، يرجى فحص ملف التكوين، تفاصيل الخطأ:", "Core Change Config Validation Failed": "فشل التحقق من التكوين عند تغيير النواة، تم استخدام التكوين الافتراضي، يرجى فحص ملف التكوين، تفاصيل الخطأ:", diff --git a/src/locales/en.json b/src/locales/en.json index 369270c3..6c49e237 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -451,14 +451,14 @@ "Global Mode": "Global Mode", "Direct Mode": "Direct Mode", "Enable Tray Speed": "Enable Tray Speed", - "Lite Mode": "Lightweight Mode", - "Lite Mode Info": "Close the GUI and keep only the kernel running", - "Lite Mode Settings": "Lite Mode Settings", - "Enter Lite Mode Now": "Enter Lite Mode Now", - "Auto Enter Lite Mode": "Auto Enter Lite Mode", - "Auto Enter Lite Mode Info": "Enable to automatically activate Lite Mode after the window is closed for a period of time", - "Auto Enter Lite Mode Delay": "Auto Enter Lite Mode Delay", - "When closing the window, Lite Mode will be automatically activated after _n minutes": "When closing the window, Lite Mode will be automatically activated after {{n}} minutes", + "LightWeight Mode": "Lightweight Mode", + "LightWeight Mode Info": "Close the GUI and keep only the kernel running", + "LightWeight Mode Settings": "LightWeight Mode Settings", + "Enter LightWeight Mode Now": "Enter LightWeight Mode Now", + "Auto Enter LightWeight Mode": "Auto Enter LightWeight Mode", + "Auto Enter LightWeight Mode Info": "Enable to automatically activate LightWeight Mode after the window is closed for a period of time", + "Auto Enter LightWeight Mode Delay": "Auto Enter LightWeight Mode Delay", + "When closing the window, LightWeight Mode will be automatically activated after _n minutes": "When closing the window, LightWeight Mode will be automatically activated after {{n}} minutes", "Config Validation Failed": "Subscription configuration validation failed. Please check the subscription configuration file; modifications have been rolled back.", "Boot Config Validation Failed": "Boot subscription configuration validation failed. Started with the default configuration; please check the subscription configuration file.", "Core Change Config Validation Failed": "Configuration validation failed when switching the kernel. Started with the default configuration; please check the subscription configuration file.", diff --git a/src/locales/fa.json b/src/locales/fa.json index efc2fa1e..04b7d241 100644 --- a/src/locales/fa.json +++ b/src/locales/fa.json @@ -433,8 +433,8 @@ "Global Mode": "حالت جهانی", "Direct Mode": "حالت مستقیم", "Enable Tray Speed": "فعال کردن سرعت ترای", - "Lite Mode": "در فارسی", - "Lite Mode Info": "رابط کاربری گرافیکی را ببندید و فقط هسته را در حال اجرا نگه دارید", + "LightWeight Mode": "در فارسی", + "LightWeight Mode Info": "رابط کاربری گرافیکی را ببندید و فقط هسته را در حال اجرا نگه دارید", "Config Validation Failed": "اعتبارسنجی پیکربندی اشتراک ناموفق بود، فایل پیکربندی را بررسی کنید، تغییرات برگشت داده شد، جزئیات خطا:", "Boot Config Validation Failed": "اعتبارسنجی پیکربندی هنگام راه‌اندازی ناموفق بود، پیکربندی پیش‌فرض استفاده شد، فایل پیکربندی را بررسی کنید، جزئیات خطا:", "Core Change Config Validation Failed": "اعتبارسنجی پیکربندی هنگام تغییر هسته ناموفق بود، پیکربندی پیش‌فرض استفاده شد، فایل پیکربندی را بررسی کنید، جزئیات خطا:", diff --git a/src/locales/id.json b/src/locales/id.json index 4b0400a3..747ec6ed 100644 --- a/src/locales/id.json +++ b/src/locales/id.json @@ -432,8 +432,8 @@ "Restore Success, App will restart in 1s": "Pemulihan Berhasil, Aplikasi akan dimulai ulang dalam 1 detik", "Failed to fetch backup files": "Gagal mengambil file cadangan", "Enable Tray Speed": "Aktifkan Tray Speed", - "Lite Mode": "Mode Ringan", - "Lite Mode Info": "Tutup GUI dan biarkan hanya kernel yang berjalan", + "LightWeight Mode": "Mode Ringan", + "LightWeight Mode Info": "Tutup GUI dan biarkan hanya kernel yang berjalan", "Config Validation Failed": "Validasi konfigurasi langganan gagal, periksa file konfigurasi, perubahan dibatalkan, detail kesalahan:", "Boot Config Validation Failed": "Validasi konfigurasi saat boot gagal, menggunakan konfigurasi default, periksa file konfigurasi, detail kesalahan:", "Core Change Config Validation Failed": "Validasi konfigurasi saat ganti inti gagal, menggunakan konfigurasi default, periksa file konfigurasi, detail kesalahan:", diff --git a/src/locales/ru.json b/src/locales/ru.json index 647773d5..672b5f99 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -433,8 +433,8 @@ "Global Mode": "Глобальный режим", "Direct Mode": "Прямой режим", "Enable Tray Speed": "Включить скорость в лотке", - "Lite Mode": "Облегченный режим", - "Lite Mode Info": "Закройте графический интерфейс и оставьте работать только ядро", + "LightWeight Mode": "Облегченный режим", + "LightWeight Mode Info": "Закройте графический интерфейс и оставьте работать только ядро", "Config Validation Failed": "Ошибка проверки конфигурации подписки, проверьте файл конфигурации, изменения отменены, ошибка:", "Boot Config Validation Failed": "Ошибка проверки конфигурации при запуске, используется конфигурация по умолчанию, проверьте файл конфигурации, ошибка:", "Core Change Config Validation Failed": "Ошибка проверки конфигурации при смене ядра, используется конфигурация по умолчанию, проверьте файл конфигурации, ошибка:", diff --git a/src/locales/tt.json b/src/locales/tt.json index 07d0352b..3cd99f36 100644 --- a/src/locales/tt.json +++ b/src/locales/tt.json @@ -432,8 +432,8 @@ "Global Mode": "Глобаль режим", "Direct Mode": "Туры режим", "Enable Tray Speed": "Трей скоростьне үстерү", - "Lite Mode": "Җиңел Режим", - "Lite Mode Info": "GUI-ны ябыгыз һәм бары тик төшне генә эшләтеп калдырыгыз", + "LightWeight Mode": "Җиңел Режим", + "LightWeight Mode Info": "GUI-ны ябыгыз һәм бары тик төшне генә эшләтеп калдырыгыз", "Config Validation Failed": "Язылу көйләү тикшерүе уңышсыз, көйләү файлын тикшерегез, үзгәрешләр кире кайтарылды, хата:", "Boot Config Validation Failed": "Йөкләү вакытында көйләү тикшерүе уңышсыз, стандарт көйләү кулланылды, көйләү файлын тикшерегез, хата:", "Core Change Config Validation Failed": "Ядро алыштырганда көйләү тикшерүе уңышсыз, стандарт көйләү кулланылды, көйләү файлын тикшерегез, хата:", diff --git a/src/locales/zh.json b/src/locales/zh.json index 3f0d53f5..ca05ddef 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -451,14 +451,14 @@ "Global Mode": "全局模式", "Direct Mode": "直连模式", "Enable Tray Speed": "启用托盘速率", - "Lite Mode": "轻量模式", - "Lite Mode Info": "关闭GUI界面,仅保留内核运行", - "Lite Mode Settings": "轻量模式设置", - "Enter Lite Mode Now": "立即进入轻量模式", - "Auto Enter Lite Mode": "自动进入轻量模式", - "Auto Enter Lite Mode Info": "启用后,将在窗口关闭一段时间后自动激活轻量模式", - "Auto Enter Lite Mode Delay": "自动进入轻量模式延迟", - "When closing the window, Lite Mode will be automatically activated after _n minutes": "关闭窗口后,轻量模式将在 {{n}} 分钟后自动激活", + "LightWeight Mode": "轻量模式", + "LightWeight Mode Info": "关闭GUI界面,仅保留内核运行", + "LightWeight Mode Settings": "轻量模式设置", + "Enter LightWeight Mode Now": "立即进入轻量模式", + "Auto Enter LightWeight Mode": "自动进入轻量模式", + "Auto Enter LightWeight Mode Info": "启用后,将在窗口关闭一段时间后自动激活轻量模式", + "Auto Enter LightWeight Mode Delay": "自动进入轻量模式延迟", + "When closing the window, LightWeight Mode will be automatically activated after _n minutes": "关闭窗口后,轻量模式将在 {{n}} 分钟后自动激活", "Config Validation Failed": "订阅配置校验失败,请检查订阅配置文件,变更已撤销,错误详情:", "Boot Config Validation Failed": "启动订阅配置校验失败,已使用默认配置启动;请检查订阅配置文件,错误详情:", "Core Change Config Validation Failed": "切换内核时配置校验失败,已使用默认配置启动;请检查订阅配置文件,错误详情:", diff --git a/src/pages/home.tsx b/src/pages/home.tsx index 272abeff..04adf1cb 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -37,7 +37,7 @@ import { BasePage } from "@/components/base"; import { ClashInfoCard } from "@/components/home/clash-info-card"; import { SystemInfoCard } from "@/components/home/system-info-card"; import { useLockFn } from "ahooks"; -import { openWebUrl, patchVergeConfig } from "@/services/cmds"; +import { entry_lightweight_mode, openWebUrl, patchVergeConfig } from "@/services/cmds"; import { TestCard } from "@/components/home/test-card"; import { IpInfoCard } from "@/components/home/ip-info-card"; @@ -259,8 +259,8 @@ const HomePage = () => { contentStyle={{ padding: 2 }} header={ - - patchVergeConfig({ enable_lite_mode: true })} size="small" color="inherit"> + + entry_lightweight_mode()} size="small" color="inherit"> diff --git a/src/services/cmds.ts b/src/services/cmds.ts index 61618ae9..9c725614 100644 --- a/src/services/cmds.ts +++ b/src/services/cmds.ts @@ -324,3 +324,11 @@ export const getAppUptime = async () => { export const installService = async () => { return invoke("install_service"); }; + +export const entry_lightweight_mode = async () => { + return invoke("entry_lightweight_mode"); +} + +export const exit_lightweight_mode = async () => { + return invoke("exit_lightweight_mode"); +} \ No newline at end of file diff --git a/src/services/types.d.ts b/src/services/types.d.ts index 32c8a9dc..fbcecf1b 100644 --- a/src/services/types.d.ts +++ b/src/services/types.d.ts @@ -739,7 +739,6 @@ interface IVergeConfig { tun_tray_icon?: boolean; enable_tray_speed?: boolean; enable_tun_mode?: boolean; - enable_lite_mode?: boolean; auto_enter_lite_mode?: boolean; auto_enter_lite_mode_delay?: number; enable_auto_launch?: boolean;