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

@ -1,5 +1,6 @@
use crate::await_sync;
use color_eyre::Result;
use std::collections::HashMap;
use std::path::Path;
use std::rc::Rc;
use std::sync::Arc;
@ -8,6 +9,8 @@ use std::sync::Arc;
pub mod clipboard;
#[cfg(feature = "workspaces")]
pub mod compositor;
#[cfg(feature = "keys")]
pub mod libinput;
#[cfg(feature = "cairo")]
pub mod lua;
#[cfg(feature = "music")]
@ -37,10 +40,12 @@ pub struct Clients {
sway: Option<Arc<sway::Client>>,
#[cfg(feature = "clipboard")]
clipboard: Option<Arc<clipboard::Client>>,
#[cfg(feature = "keys")]
libinput: HashMap<Box<str>, Arc<libinput::Client>>,
#[cfg(feature = "cairo")]
lua: Option<Rc<lua::LuaEngine>>,
#[cfg(feature = "music")]
music: std::collections::HashMap<music::ClientType, Arc<dyn music::MusicClient>>,
music: HashMap<music::ClientType, Arc<dyn music::MusicClient>>,
#[cfg(feature = "network_manager")]
network_manager: Option<Arc<networkmanager::Client>>,
#[cfg(feature = "notifications")]
@ -111,6 +116,14 @@ impl Clients {
.clone()
}
#[cfg(feature = "keys")]
pub fn libinput(&mut self, seat: &str) -> Arc<libinput::Client> {
self.libinput
.entry(seat.into())
.or_insert_with(|| libinput::Client::init(seat.to_string()))
.clone()
}
#[cfg(feature = "music")]
pub fn music(&mut self, client_type: music::ClientType) -> Arc<dyn music::MusicClient> {
self.music