feat: Service Mode for Linux (#804)
This commit is contained in:
15
src-tauri/src/utils/unix_helper.rs
Normal file
15
src-tauri/src/utils/unix_helper.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use std::process::Command;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn linux_elevator() -> &'static str {
|
||||
match Command::new("which").arg("pkexec").output() {
|
||||
Ok(output) => {
|
||||
if output.stdout.is_empty() {
|
||||
"sudo"
|
||||
} else {
|
||||
"pkexec"
|
||||
}
|
||||
}
|
||||
Err(_) => "sudo",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user