feat: Modify startup logic and install services by default

This commit is contained in:
huzibaca
2024-10-10 00:34:36 +08:00
parent 30c77b891d
commit 3f3fad0db7
12 changed files with 126 additions and 436 deletions

View File

@@ -105,6 +105,21 @@ pub fn open_file(app: tauri::AppHandle, path: PathBuf) -> Result<()> {
Ok(())
}
#[cfg(target_os = "linux")]
pub fn linux_elevator() -> &'static str {
use std::process::Command;
match Command::new("which").arg("pkexec").output() {
Ok(output) => {
if output.stdout.is_empty() {
"sudo"
} else {
"pkexec"
}
}
Err(_) => "sudo",
}
}
#[macro_export]
macro_rules! error {
($result: expr) => {