From ec156a858795b7f31cac51845d9cf3197a063f92 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 24 Feb 2024 10:08:56 +0400 Subject: Add environment {} config section --- src/utils/spawning.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/utils/spawning.rs') diff --git a/src/utils/spawning.rs b/src/utils/spawning.rs index d212ea18..494ec997 100644 --- a/src/utils/spawning.rs +++ b/src/utils/spawning.rs @@ -4,9 +4,11 @@ use std::os::unix::process::CommandExt; use std::path::Path; use std::process::{Command, Stdio}; use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::RwLock; use std::{io, thread}; use libc::close_range; +use niri_config::Environment; use smithay::reexports::rustix; use smithay::reexports::rustix::io::{close, read, retry_on_intr, write}; use smithay::reexports::rustix::pipe::{pipe_with, PipeFlags}; @@ -15,6 +17,7 @@ use crate::utils::expand_home; pub static REMOVE_ENV_RUST_BACKTRACE: AtomicBool = AtomicBool::new(false); pub static REMOVE_ENV_RUST_LIB_BACKTRACE: AtomicBool = AtomicBool::new(false); +pub static CHILD_ENV: RwLock = RwLock::new(Environment(Vec::new())); /// Spawns the command to run independently of the compositor. pub fn spawn + Send + 'static>(command: Vec) { @@ -67,6 +70,17 @@ fn spawn_sync(command: impl AsRef, args: impl IntoIterator