diff --git a/api/rust/src/input.rs b/api/rust/src/input.rs index 9f94b9d..42589ad 100644 --- a/api/rust/src/input.rs +++ b/api/rust/src/input.rs @@ -82,6 +82,30 @@ impl Input { send_msg(msg).unwrap(); } + + /// Set the xkbconfig for your keyboard. + /// + /// Parameters set to `None` will be set to their default values. + /// + /// Read `xkeyboard-config(7)` for more information. + pub fn set_xkb_config( + &self, + rules: Option<&str>, + model: Option<&str>, + layout: Option<&str>, + variant: Option<&str>, + options: Option<&str>, + ) { + let msg = Msg::SetXkbConfig { + rules: rules.map(|s| s.to_string()), + variant: variant.map(|s| s.to_string()), + layout: layout.map(|s| s.to_string()), + model: model.map(|s| s.to_string()), + options: options.map(|s| s.to_string()), + }; + + send_msg(msg).unwrap(); + } } /// A mouse button. diff --git a/api/rust/src/process.rs b/api/rust/src/process.rs index 4e8d504..e3a3427 100644 --- a/api/rust/src/process.rs +++ b/api/rust/src/process.rs @@ -56,4 +56,18 @@ impl Process { send_msg(msg) } + + /// Set an environment variable for Pinnacle. All future processes spawned will have this env set. + /// + /// Note that this will only set the variable for the compositor, not the running config process. + /// If you need to set an environment variable for this config, place them in the `metaconfig.toml` file instead + /// or use [`std::env::set_var`]. + pub fn set_env(&self, key: &str, value: &str) { + let msg = Msg::SetEnv { + key: key.to_string(), + value: value.to_string(), + }; + + send_msg(msg).unwrap(); + } } diff --git a/api/rust/src/window/rules.rs b/api/rust/src/window/rules.rs index f8efb14..f946c2d 100644 --- a/api/rust/src/window/rules.rs +++ b/api/rust/src/window/rules.rs @@ -128,7 +128,7 @@ impl WindowRuleCondition { /// This condition requires that the window's is opened on the given tags. /// /// When used in a top level condition or inside of [`WindowRuleCondition::all`], - /// the window must opne on *all* given tags. + /// the window must open on *all* given tags. /// /// When used in [`WindowRuleCondition::any`], the window must open on at least /// one of the given tags.