feat: add systemd notify with feature
This commit is contained in:
parent
d32eae139d
commit
d8bfa0a1a3
3 changed files with 16 additions and 0 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -464,6 +464,12 @@ version = "1.0.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
|
||||
|
||||
[[package]]
|
||||
name = "sd-notify"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4646d6f919800cd25c50edb49438a1381e2cd4833c027e75e8897981c50b8b5e"
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
|
|
@ -856,6 +862,7 @@ dependencies = [
|
|||
"paste",
|
||||
"pretty_env_logger",
|
||||
"rustix",
|
||||
"sd-notify",
|
||||
"slotmap",
|
||||
"smithay-client-toolkit",
|
||||
"testwl",
|
||||
|
|
|
|||
|
|
@ -34,6 +34,12 @@ slotmap = "1.0.7"
|
|||
xcb-util-cursor = "0.3.2"
|
||||
smithay-client-toolkit = { version = "0.19.1", default-features = false }
|
||||
|
||||
sd-notify = { version = "0.4.2", optional = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
systemd = ["dep:sd-notify"]
|
||||
|
||||
[dev-dependencies]
|
||||
rustix = { workspace = true, features = ["fs"] }
|
||||
testwl = { path = "testwl" }
|
||||
|
|
|
|||
|
|
@ -158,6 +158,9 @@ pub fn main(data: impl RunData) -> Option<()> {
|
|||
data.xwayland_ready(display);
|
||||
server_state.set_x_connection(xstate.connection.clone());
|
||||
server_state.atoms = Some(xstate.atoms.clone());
|
||||
|
||||
#[cfg(feature = "systemd")]
|
||||
let _ = sd_notify::notify(true, &[sd_notify::NotifyState::Ready]);
|
||||
}
|
||||
|
||||
if let Some(xstate) = &mut xstate {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue