aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/niri.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs
index a7dbfb54..9b6e3a17 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -166,8 +166,22 @@ impl Niri {
dbus-update-activation-environment WAYLAND_DISPLAY",
])
.spawn();
- if let Err(err) = rv {
- warn!("error spawning shell to import environment into systemd: {err:?}");
+ // Wait for the import process to complete, otherwise services will start too fast
+ // without environment variables available.
+ match rv {
+ Ok(mut child) => match child.wait() {
+ Ok(status) => {
+ if !status.success() {
+ warn!("import environment shell exited with {status}");
+ }
+ }
+ Err(err) => {
+ warn!("error waiting for import environment shell: {err:?}");
+ }
+ },
+ Err(err) => {
+ warn!("error spawning shell to import environment into systemd: {err:?}");
+ }
}
// Set up zbus, make sure it happens before anything might want it.