mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Export NIRI_SOCKET to systemd/dbus environment
This commit is contained in:
@@ -44,4 +44,4 @@ systemctl --user --wait start niri.service
|
|||||||
systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
|
systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
|
||||||
|
|
||||||
# Unset environment that we've set.
|
# Unset environment that we've set.
|
||||||
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
|
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
|
||||||
|
|||||||
+7
-3
@@ -235,12 +235,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn import_env_to_systemd() {
|
fn import_env_to_systemd() {
|
||||||
|
let variables = ["WAYLAND_DISPLAY", niri_ipc::SOCKET_PATH_ENV].join(" ");
|
||||||
|
|
||||||
let rv = Command::new("/bin/sh")
|
let rv = Command::new("/bin/sh")
|
||||||
.args([
|
.args([
|
||||||
"-c",
|
"-c",
|
||||||
"systemctl --user import-environment WAYLAND_DISPLAY && \
|
&format!(
|
||||||
hash dbus-update-activation-environment 2>/dev/null && \
|
"systemctl --user import-environment {variables} && \
|
||||||
dbus-update-activation-environment WAYLAND_DISPLAY",
|
hash dbus-update-activation-environment 2>/dev/null && \
|
||||||
|
dbus-update-activation-environment {variables}"
|
||||||
|
),
|
||||||
])
|
])
|
||||||
.spawn();
|
.spawn();
|
||||||
// Wait for the import process to complete, otherwise services will start too fast without
|
// Wait for the import process to complete, otherwise services will start too fast without
|
||||||
|
|||||||
Reference in New Issue
Block a user