forge
Explore
Log in

Don't you dare go Hollow

Export NIRI_SOCKET to systemd/dbus environment

Browse files at this commit

a9fcbf81eb3e5247f699afeee1f078b0dcd93fc3Ivan MolodetskikhParent: a99f34c
resources/niri-sessionmodified+1 -1
@@ -44,4 +44,4 @@ systemctl --user --wait start niri.service
4444 systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
4545
4646 # Unset environment that we've set.
47-systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
47+systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
src/main.rsmodified+7 -3
@@ -235,12 +235,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
235235 }
236236
237237 fn import_env_to_systemd() {
238+ let variables = ["WAYLAND_DISPLAY", niri_ipc::SOCKET_PATH_ENV].join(" ");
239+
238240 let rv = Command::new("/bin/sh")
239241 .args([
240242 "-c",
241- "systemctl --user import-environment WAYLAND_DISPLAY && \
242- hash dbus-update-activation-environment 2>/dev/null && \
243- dbus-update-activation-environment WAYLAND_DISPLAY",
243+ &format!(
244+ "systemctl --user import-environment {variables} && \
245+ hash dbus-update-activation-environment 2>/dev/null && \
246+ dbus-update-activation-environment {variables}"
247+ ),
244248 ])
245249 .spawn();
246250 // Wait for the import process to complete, otherwise services will start too fast without