diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-04-12 12:05:08 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-06-01 13:34:44 +0300 |
| commit | 2da90fc625725c6d3465c920826e2718579cfb40 (patch) | |
| tree | 71e24548972604aaf741e52e6e7a6ba74a95b716 /src/wm_info_provider.rs | |
| parent | 84b8dfe8cd190de33221f465a7059be6a30769f5 (diff) | |
| download | i3bar-mango-2da90fc625725c6d3465c920826e2718579cfb40.tar.gz | |
WIP: hyprland support
Diffstat (limited to 'src/wm_info_provider.rs')
| -rw-r--r-- | src/wm_info_provider.rs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs index 12e4fb8..7f2d941 100644 --- a/src/wm_info_provider.rs +++ b/src/wm_info_provider.rs @@ -1,3 +1,4 @@ +mod ext_workspace_unstable; mod river; use wayrs_client::connection::Connection; @@ -6,10 +7,13 @@ use wayrs_client::global::*; use crate::pointer_btn::PointerBtn; use crate::protocol::*; use crate::state::State; +use ext_workspace_unstable::*; +use river::*; pub enum WmInfoProvider { None, - River(river::RiverInfoProvider), + River(RiverInfoProvider), + EWU(ExtWorkspaceUnstable), } pub type WmInfoCallback = fn(&mut Connection<State>, &mut State, WlOutput, WmInfo); @@ -20,21 +24,28 @@ impl WmInfoProvider { globals: &Globals, callback: WmInfoCallback, ) -> WmInfoProvider { - let Some(river) = river::RiverInfoProvider::bind(conn, globals, callback) else { return Self::None }; - Self::River(river) + if let Some(river) = RiverInfoProvider::bind(conn, globals, callback) { + Self::River(river) + } else if let Some(ext_wp_u) = ExtWorkspaceUnstable::bind(conn, globals, callback) { + Self::EWU(ext_wp_u) + } else { + Self::None + } } pub fn new_ouput(&mut self, conn: &mut Connection<State>, output: WlOutput) { match self { Self::None => (), - Self::River(river) => river.new_output(conn, output), + Self::River(x) => x.new_output(conn, output), + Self::EWU(x) => x.new_ouput(conn, output), } } pub fn output_removed(&mut self, conn: &mut Connection<State>, output: WlOutput) { match self { Self::None => (), - Self::River(river) => river.output_removed(conn, output), + Self::River(x) => x.output_removed(conn, output), + Self::EWU(x) => x.output_removed(conn, output), } } @@ -48,17 +59,19 @@ impl WmInfoProvider { ) { match self { Self::None => (), - Self::River(river) => river.click_on_tag(conn, output, seat, tag, btn), + Self::River(x) => x.click_on_tag(conn, output, seat, tag, btn), + Self::EWU(x) => x.click_on_tag(conn, output, seat, tag, btn), } } } -#[derive(Default)] +#[derive(Default, Debug)] pub struct WmInfo { pub layout_name: Option<String>, pub tags: Vec<Tag>, } +#[derive(Debug)] pub struct Tag { pub name: String, pub is_focused: bool, |
