summaryrefslogtreecommitdiff
path: root/src/wm_info_provider.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_info_provider.rs')
-rw-r--r--src/wm_info_provider.rs19
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,