From 74cc46a2383db5538d7e0392e4b79b7287775e9b Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Thu, 7 Sep 2023 00:47:28 +0300 Subject: hyprland again --- src/wm_info_provider.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/wm_info_provider.rs') 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, output: WlOutput); fn output_removed(&mut self, conn: &mut Connection, output: WlOutput); - fn get_tags(&self, output: WlOutput) -> Vec; - fn get_layout_name(&self, output: WlOutput) -> Option; - fn get_mode_name(&self, output: WlOutput) -> Option; + fn get_tags(&self, output: &Output) -> Vec; + fn get_layout_name(&self, output: &Output) -> Option; + fn get_mode_name(&self, output: &Output) -> Option; fn click_on_tag( &mut self, conn: &mut Connection, output: WlOutput, seat: WlSeat, - tag: &str, + tag_id: u32, btn: PointerBtn, ); @@ -34,17 +39,23 @@ pub trait WmInfoProvider { pub fn bind( conn: &mut Connection, globals: &Globals, + event_loop: &mut EventLoop<(Connection, State)>, config: &WmConfig, ) -> Option> { 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, -- cgit v1.3.1