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
44 systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target44 systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
45 45
46 # Unset environment that we've set.46 # Unset environment that we've set.
47-systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP47+systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
src/main.rsmodified+6 -2
@@ -235,12 +235,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
235 }235 }
236 236
237 fn import_env_to_systemd() {237 fn import_env_to_systemd() {
238+ let variables = ["WAYLAND_DISPLAY", niri_ipc::SOCKET_PATH_ENV].join(" ");
239+
238 let rv = Command::new("/bin/sh")240 let rv = Command::new("/bin/sh")
239 .args([241 .args([
240 "-c",242 "-c",
241- "systemctl --user import-environment WAYLAND_DISPLAY && \243+ &format!(
244+ "systemctl --user import-environment {variables} && \
242 hash dbus-update-activation-environment 2>/dev/null && \245 hash dbus-update-activation-environment 2>/dev/null && \
243- dbus-update-activation-environment WAYLAND_DISPLAY",246+ dbus-update-activation-environment {variables}"
247+ ),
244 ])248 ])
245 .spawn();249 .spawn();
246 // Wait for the import process to complete, otherwise services will start too fast without250 // Wait for the import process to complete, otherwise services will start too fast without