Invoke systemctl via PATH instead of /usr/bin
The absolute path assumes an FHS layout and fails on distributions that place systemctl elsewhere, such as NixOS.
This commit is contained in:
Generated
+1
-1
@@ -575,7 +575,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "moonlock"
|
||||
version = "0.6.20"
|
||||
version = "0.6.21"
|
||||
dependencies = [
|
||||
"gdk-pixbuf",
|
||||
"gdk4",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "moonlock"
|
||||
version = "0.6.20"
|
||||
version = "0.6.21"
|
||||
edition = "2024"
|
||||
description = "A secure Wayland lockscreen with GTK4, PAM and fingerprint support"
|
||||
license = "MIT"
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ fn run_command(action: &'static str, program: &str, args: &[&str]) -> Result<(),
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn reboot() -> Result<(), PowerError> { run_command("reboot", "/usr/bin/systemctl", &["--no-ask-password", "reboot"]) }
|
||||
pub fn shutdown() -> Result<(), PowerError> { run_command("shutdown", "/usr/bin/systemctl", &["--no-ask-password", "poweroff"]) }
|
||||
pub fn reboot() -> Result<(), PowerError> { run_command("reboot", "systemctl", &["--no-ask-password", "reboot"]) }
|
||||
pub fn shutdown() -> Result<(), PowerError> { run_command("shutdown", "systemctl", &["--no-ask-password", "poweroff"]) }
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
Reference in New Issue
Block a user