fix(elevate): fix panic on NixOS (#1634)

This commit is contained in:
starrain
2025-12-01 01:12:08 +08:00
committed by GitHub
parent 70b122fb91
commit bb82b3a5b0

View File

@@ -24,8 +24,7 @@ impl Command {
/// Prompting the user with a graphical OS dialog for the root password, /// Prompting the user with a graphical OS dialog for the root password,
/// excuting the command with escalated privileges, and return the output /// excuting the command with escalated privileges, and return the output
pub fn output(&self) -> Result<Output> { pub fn output(&self) -> Result<Output> {
let pkexec = PathBuf::from_str("/bin/pkexec")?; let mut command = StdCommand::new("pkexec");
let mut command = StdCommand::new(pkexec);
let display = env::var("DISPLAY"); let display = env::var("DISPLAY");
let xauthority = env::var("XAUTHORITY"); let xauthority = env::var("XAUTHORITY");
let home = env::var("HOME"); let home = env::var("HOME");