From bee16cced1e03419f31534d2811233f7aadd0043 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:16:22 +0100 Subject: [PATCH] sd-notify support --- Cargo.lock | 10 ++++++++++ Cargo.toml | 1 + src/main.rs | 2 ++ 3 files changed, 13 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d153cab..eda7dca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -312,6 +312,7 @@ dependencies = [ "image", "log", "palette", + "sd-notify", "smithay-client-toolkit", "wayland-client", ] @@ -1314,6 +1315,15 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] name = "serde_core" version = "1.0.228" diff --git a/Cargo.toml b/Cargo.toml index 5a677da..4771217 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ freedesktop-icons = "0.4.0" image = "0.25.9" log = "0.4.29" palette = "0.7.6" +sd-notify = "0.4.5" smithay-client-toolkit = "0.20.0" wayland-client = "0.31.11" diff --git a/src/main.rs b/src/main.rs index 8bf1e2b..cee2f7b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,6 +72,8 @@ fn main() -> Result<()> { .insert(event_loop.handle()) .wrap_err("failed to register wayland event source")?; + let _ = sd_notify::notify(true, &[sd_notify::NotifyState::Ready]); + loop { event_loop .dispatch(Duration::from_millis(16), &mut app)