fix: use systemctl for reboot/shutdown — loginctl lacks these verbs (v0.7.3)
This commit is contained in:
parent
2ca572773e
commit
e59ed53d7a
@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
Format based on [Keep a Changelog](https://keepachangelog.com/).
|
Format based on [Keep a Changelog](https://keepachangelog.com/).
|
||||||
|
|
||||||
|
## [0.7.3] - 2026-03-29
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix shutdown and reboot — `loginctl` does not support `poweroff`/`reboot` verbs, switched to `systemctl poweroff` and `systemctl reboot`
|
||||||
|
|
||||||
## [0.7.2] - 2026-03-29
|
## [0.7.2] - 2026-03-29
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "moonset"
|
name = "moonset"
|
||||||
version = "0.7.2"
|
version = "0.7.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "Wayland session power menu with GTK4 and Layer Shell"
|
description = "Wayland session power menu with GTK4 and Layer Shell"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@ -127,14 +127,14 @@ pub fn hibernate() -> Result<(), PowerError> {
|
|||||||
run_command("hibernate", "/usr/bin/systemctl", &["hibernate"])
|
run_command("hibernate", "/usr/bin/systemctl", &["hibernate"])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reboot the system via loginctl.
|
/// Reboot the system via systemctl.
|
||||||
pub fn reboot() -> Result<(), PowerError> {
|
pub fn reboot() -> Result<(), PowerError> {
|
||||||
run_command("reboot", "/usr/bin/loginctl", &["reboot"])
|
run_command("reboot", "/usr/bin/systemctl", &["reboot"])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shut down the system via loginctl.
|
/// Shut down the system via systemctl.
|
||||||
pub fn shutdown() -> Result<(), PowerError> {
|
pub fn shutdown() -> Result<(), PowerError> {
|
||||||
run_command("shutdown", "/usr/bin/loginctl", &["poweroff"])
|
run_command("shutdown", "/usr/bin/systemctl", &["poweroff"])
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user