config: add various new functions
This commit is contained in:
parent
f1a3705699
commit
e24a61bc62
12 changed files with 435 additions and 28 deletions
|
|
@ -42,7 +42,10 @@
|
|||
use {
|
||||
crate::keyboard::ModifiedKeySym,
|
||||
serde::{Deserialize, Serialize},
|
||||
std::fmt::{Debug, Display, Formatter},
|
||||
std::{
|
||||
fmt::{Debug, Display, Formatter},
|
||||
time::Duration,
|
||||
},
|
||||
};
|
||||
|
||||
#[macro_use]
|
||||
|
|
@ -195,3 +198,20 @@ pub fn on_idle<F: FnMut() + 'static>(f: F) {
|
|||
pub fn on_devices_enumerated<F: FnOnce() + 'static>(f: F) {
|
||||
get!().on_devices_enumerated(f)
|
||||
}
|
||||
|
||||
/// Returns the Jay config directory.
|
||||
pub fn config_dir() -> String {
|
||||
get!().config_dir()
|
||||
}
|
||||
|
||||
/// Returns all visible workspaces.
|
||||
pub fn workspaces() -> Vec<Workspace> {
|
||||
get!().workspaces()
|
||||
}
|
||||
|
||||
/// Configures the idle timeout.
|
||||
///
|
||||
/// `None` disables the timeout.
|
||||
pub fn set_idle(timeout: Option<Duration>) {
|
||||
get!().set_idle(timeout.unwrap_or_default())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue