Add missing methods

This commit is contained in:
Ottatop 2023-10-19 23:10:02 -05:00
parent f0e2282445
commit 788910e503
3 changed files with 39 additions and 1 deletions

View file

@ -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.

View file

@ -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();
}
}

View file

@ -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.