1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

feat: libinput keys module

Adds a new module which shows the status of toggle mod keys (capslock, num lock, scroll lock).

Resolves #700
This commit is contained in:
Jake Stanger 2024-11-17 23:46:02 +00:00
parent 353ee92d48
commit ccfe73f6a7
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
20 changed files with 799 additions and 107 deletions

View file

@ -41,7 +41,7 @@ macro_rules! send_async {
};
}
/// Sends a message on an synchronous `Sender` using `send()`
/// Sends a message on a synchronous `Sender` using `send()`
/// Panics if the message cannot be sent.
///
/// # Usage:
@ -56,7 +56,7 @@ macro_rules! send {
};
}
/// Sends a message on an synchronous `Sender` using `try_send()`
/// Sends a message on a synchronous `Sender` using `try_send()`
/// Panics if the message cannot be sent.
///
/// # Usage:
@ -71,6 +71,26 @@ macro_rules! try_send {
};
}
/// Sends a message, wrapped inside a `ModuleUpdateEvent::Update` variant,
/// on an asynchronous `Sender` using `send()`.
///
/// This is a convenience wrapper around `send_async`
/// to avoid needing to write the full enum every time.
///
/// Panics if the message cannot be sent.
///
/// # Usage:
///
/// ```rs
/// module_update!(tx, "my event");
/// ```
#[macro_export]
macro_rules! module_update {
($tx:expr, $msg:expr) => {
send_async!($tx, $crate::modules::ModuleUpdateEvent::Update($msg))
};
}
/// Spawns a `GLib` future on the local thread, and calls `rx.recv()`
/// in a loop.
///