diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-09-13 15:45:30 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-09-13 15:45:30 +0300 |
| commit | 22fee7b003b6a9b107eeb5000bd55b76287c9023 (patch) | |
| tree | 5a7f1208d469b8f4ee1a68a036a18a14a711bf0d | |
| parent | e95d28e148d6b278e2e836cab67340d5f05a07ff (diff) | |
| download | niri-22fee7b003b6a9b107eeb5000bd55b76287c9023.tar.gz niri-22fee7b003b6a9b107eeb5000bd55b76287c9023.tar.bz2 niri-22fee7b003b6a9b107eeb5000bd55b76287c9023.zip | |
Add NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY env
Useful for UWSM I guess.
| -rw-r--r-- | src/main.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 4345e81c..d0de54a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -212,14 +212,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { #[cfg(feature = "dbus")] dbus::DBusServers::start(&mut state, cli.session); - // Notify systemd we're ready. - if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) { - warn!("error notifying systemd: {err:?}"); - }; - - // Send ready notification to the NOTIFY_FD file descriptor. - if let Err(err) = notify_fd() { - warn!("error notifying fd: {err:?}"); + if env::var_os("NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY").map_or(true, |x| x != "1") { + // Notify systemd we're ready. + if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) { + warn!("error notifying systemd: {err:?}"); + }; + + // Send ready notification to the NOTIFY_FD file descriptor. + if let Err(err) = notify_fd() { + warn!("error notifying fd: {err:?}"); + } } // Set up config file watcher. |
