diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-09-07 00:47:28 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-09-07 00:47:28 +0300 |
| commit | 74cc46a2383db5538d7e0392e4b79b7287775e9b (patch) | |
| tree | 6f5c2c026c0822dd71a645836eb085677a090d4c /src/wm_info_provider.rs | |
| parent | eefff9a9cc2ee6f17eab3431cc808d5a5e7d31fc (diff) | |
| download | i3bar-mango-74cc46a2383db5538d7e0392e4b79b7287775e9b.tar.gz | |
hyprland again
Diffstat (limited to 'src/wm_info_provider.rs')
| -rw-r--r-- | src/wm_info_provider.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs index e9af320..e1004fa 100644 --- a/src/wm_info_provider.rs +++ b/src/wm_info_provider.rs @@ -4,6 +4,8 @@ use wayrs_client::global::*; use wayrs_client::Connection; use crate::config::WmConfig; +use crate::event_loop::EventLoop; +use crate::output::Output; use crate::pointer_btn::PointerBtn; use crate::protocol::*; use crate::state::State; @@ -11,20 +13,23 @@ use crate::state::State; mod river; pub use river::*; +mod hyprland; +pub use hyprland::*; + pub trait WmInfoProvider { fn new_ouput(&mut self, conn: &mut Connection<State>, output: WlOutput); fn output_removed(&mut self, conn: &mut Connection<State>, output: WlOutput); - fn get_tags(&self, output: WlOutput) -> Vec<Tag>; - fn get_layout_name(&self, output: WlOutput) -> Option<String>; - fn get_mode_name(&self, output: WlOutput) -> Option<String>; + fn get_tags(&self, output: &Output) -> Vec<Tag>; + fn get_layout_name(&self, output: &Output) -> Option<String>; + fn get_mode_name(&self, output: &Output) -> Option<String>; fn click_on_tag( &mut self, conn: &mut Connection<State>, output: WlOutput, seat: WlSeat, - tag: &str, + tag_id: u32, btn: PointerBtn, ); @@ -34,17 +39,23 @@ pub trait WmInfoProvider { pub fn bind( conn: &mut Connection<State>, globals: &Globals, + event_loop: &mut EventLoop<(Connection<State>, State)>, config: &WmConfig, ) -> Option<Box<dyn WmInfoProvider>> { if let Some(river) = RiverInfoProvider::bind(conn, globals, config) { return Some(Box::new(river)); } + if let Some(hyprland) = Hyprland::new(event_loop) { + return Some(Box::new(hyprland)); + } + None } #[derive(Debug)] pub struct Tag { + pub id: u32, pub name: String, pub is_focused: bool, pub is_active: bool, |
