mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: integrate tauri-plugin-clipboard-manager and add system info commands (#5593)
This commit is contained in:
@@ -255,15 +255,9 @@ async fn reinstall_service() -> Result<()> {
|
||||
#[cfg(target_os = "linux")]
|
||||
fn linux_running_as_root() -> bool {
|
||||
use crate::core::handle;
|
||||
use parking_lot::RwLock;
|
||||
use tauri::Manager as _;
|
||||
use tauri_plugin_clash_verge_sysinfo::Platform;
|
||||
use tauri_plugin_clash_verge_sysinfo::is_current_app_handle_admin;
|
||||
let app_handle = handle::Handle::app_handle();
|
||||
app_handle
|
||||
.state::<RwLock<Platform>>()
|
||||
.read()
|
||||
.appinfo
|
||||
.app_is_admin
|
||||
is_current_app_handle_admin(app_handle)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use once_cell::sync::OnceCell;
|
||||
use tauri::tray::TrayIconBuilder;
|
||||
use tauri_plugin_clash_verge_sysinfo::is_current_app_handle_admin;
|
||||
use tauri_plugin_mihomo::models::Proxies;
|
||||
use tokio::fs;
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -303,8 +304,8 @@ impl Tray {
|
||||
let verge = Config::verge().await.latest_arc();
|
||||
let system_proxy = verge.enable_system_proxy.as_ref().unwrap_or(&false);
|
||||
let tun_mode = verge.enable_tun_mode.as_ref().unwrap_or(&false);
|
||||
let tun_mode_available =
|
||||
cmd::system::is_admin() || service::is_service_available().await.is_ok();
|
||||
let tun_mode_available = is_current_app_handle_admin(app_handle)
|
||||
|| service::is_service_available().await.is_ok();
|
||||
let mode = {
|
||||
Config::clash()
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user