diff options
Diffstat (limited to 'src/wm_info_provider')
| -rw-r--r-- | src/wm_info_provider/dummy.rs | 9 | ||||
| -rw-r--r-- | src/wm_info_provider/hyprland.rs | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/wm_info_provider/dummy.rs b/src/wm_info_provider/dummy.rs new file mode 100644 index 0000000..72903c7 --- /dev/null +++ b/src/wm_info_provider/dummy.rs @@ -0,0 +1,9 @@ +use super::*; + +pub struct DummyInfoProvider; + +impl WmInfoProvider for DummyInfoProvider { + fn as_any(&mut self) -> &mut dyn Any { + self + } +} diff --git a/src/wm_info_provider/hyprland.rs b/src/wm_info_provider/hyprland.rs index 1233e66..c754806 100644 --- a/src/wm_info_provider/hyprland.rs +++ b/src/wm_info_provider/hyprland.rs @@ -10,13 +10,13 @@ use crate::event_loop::{self, EventLoop}; use crate::state::State; use crate::utils::read_to_vec; -pub struct Hyprland { +pub struct HyprlandInfoProvider { ipc: Ipc, workspaces: Vec<IpcWorkspace>, active_id: u32, } -impl Hyprland { +impl HyprlandInfoProvider { pub fn new() -> Option<Self> { let his = std::env::var("HYPRLAND_INSTANCE_SIGNATURE").ok()?; let ipc = Ipc::new(&his).ok()?; @@ -28,7 +28,7 @@ impl Hyprland { } } -impl WmInfoProvider for Hyprland { +impl WmInfoProvider for HyprlandInfoProvider { fn register(&self, event_loop: &mut EventLoop) { event_loop.register_with_fd(self.ipc.sock2.as_raw_fd(), |ctx| { match hyprland_cb(ctx.conn, ctx.state) { |
