diff options
| author | srdusr <[email protected]> | 2025-01-17 23:01:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2025-01-17 23:01:00 +0200 |
| commit | 6c1dfe191843ad56aaa0381e5645ad9e74c38b8b (patch) | |
| tree | 427d72a55eba93b2f0da299342c12bd3c61df1d6 /crates/config/src/engine/general.rs | |
| parent | 3d73ed0f057a555ded67ad58dbe02b36cd4d2d1f (diff) | |
| download | srdwm-6c1dfe191843ad56aaa0381e5645ad9e74c38b8b.tar.gz srdwm-6c1dfe191843ad56aaa0381e5645ad9e74c38b8b.zip | |
Accumulate config engine, build metadata, and doc updates
Remaining files from the backlog: Lua config engine
additions (general/register/support/window), workspace Cargo.toml/
Cargo.lock churn from the new dependencies added elsewhere in this
sweep, srdwm/main.rs wiring, and docs (DEFAULTS.md plus a new
SESSION_HANDOFF.md written mid-session for continuity across a restart
- see that file's own header for what it is and isn't).
Diffstat (limited to 'crates/config/src/engine/general.rs')
| -rw-r--r-- | crates/config/src/engine/general.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/crates/config/src/engine/general.rs b/crates/config/src/engine/general.rs index 96ea4d3..98cfebe 100644 --- a/crates/config/src/engine/general.rs +++ b/crates/config/src/engine/general.rs @@ -128,7 +128,8 @@ impl Engine { /// class_regex = "...", instance = "..." }, { floating = true, /// workspace = 2, x = .., y = .., width = .., height = .., /// decorated = false, border_color = {r,g,b}, border_width = 2, - /// maximized = true, opacity = 0.9 })`. At least one matcher field is + /// corner_radius = 10, maximized = true, opacity = 0.9 })`. At least + /// one matcher field is /// required; unmatched rules apply nothing. /// /// `title`/`class` are plain substring/exact match, cheap and cover @@ -182,6 +183,7 @@ impl Engine { decorated: actions.get("decorated")?, border_color, border_width: actions.get("border_width")?, + corner_radius: actions.get("corner_radius")?, pinned: actions.get("pinned")?, opacity: actions.get("opacity")?, resize_margin: actions.get("resize_margin")?, @@ -217,6 +219,22 @@ impl Engine { })?) } + /// Sets an environment variable in srdwm's own process - `std::process:: + /// Command` inherits the parent's environment by default (`fn_spawn` + /// above never overrides that), so anything set here is visible to + /// every process `srd.spawn` starts from this point on, and to their own + /// children in turn. Hyprland's `env = NAME,VALUE` works the same way + /// (sets it in its own process before forking anything), which is the + /// mechanism a ported `env.conf` needs - there is no per-spawn + /// equivalent that would let one client see a variable no other client + /// does, so this is deliberately global and process-wide, not scoped. + pub(super) fn fn_setenv(&self) -> Result<mlua::Function<'_>> { + Ok(self.lua.create_function(move |_, (name, value): (String, String)| { + std::env::set_var(&name, &value); + Ok(()) + })?) + } + pub(super) fn fn_quit(&self) -> Result<mlua::Function<'_>> { let state = self.state.clone(); Ok(self.lua.create_function(move |_, ()| { |