sd-notify support

This commit is contained in:
nora 2025-12-29 19:16:22 +01:00
parent cd0c164977
commit bee16cced1
3 changed files with 13 additions and 0 deletions

10
Cargo.lock generated
View file

@ -312,6 +312,7 @@ dependencies = [
"image", "image",
"log", "log",
"palette", "palette",
"sd-notify",
"smithay-client-toolkit", "smithay-client-toolkit",
"wayland-client", "wayland-client",
] ]
@ -1314,6 +1315,15 @@ version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "sd-notify"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b943eadf71d8b69e661330cb0e2656e31040acf21ee7708e2c238a0ec6af2bf4"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "serde_core" name = "serde_core"
version = "1.0.228" version = "1.0.228"

View file

@ -11,6 +11,7 @@ freedesktop-icons = "0.4.0"
image = "0.25.9" image = "0.25.9"
log = "0.4.29" log = "0.4.29"
palette = "0.7.6" palette = "0.7.6"
sd-notify = "0.4.5"
smithay-client-toolkit = "0.20.0" smithay-client-toolkit = "0.20.0"
wayland-client = "0.31.11" wayland-client = "0.31.11"

View file

@ -72,6 +72,8 @@ fn main() -> Result<()> {
.insert(event_loop.handle()) .insert(event_loop.handle())
.wrap_err("failed to register wayland event source")?; .wrap_err("failed to register wayland event source")?;
let _ = sd_notify::notify(true, &[sd_notify::NotifyState::Ready]);
loop { loop {
event_loop event_loop
.dispatch(Duration::from_millis(16), &mut app) .dispatch(Duration::from_millis(16), &mut app)