diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-19 15:53:47 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-19 18:53:47 +0300 |
| commit | 73446cac559b10adf4beb5567a816d1be5273457 (patch) | |
| tree | 214aaa0c32d79c0184406e7a4abd7618c5f275fe /src/wm_info_provider.rs | |
| parent | c9cee90d765198cf72c5a5155ee0d8ab566d98a9 (diff) | |
| download | i3bar-mango-73446cac559b10adf4beb5567a816d1be5273457.tar.gz | |
Support disabling WM support (#45)
Most people profit from a bar that supports multiple compositors.
But some (like me), depend on special features of a compositor and as such
only ever use one of the supported compositors. Being able to disable support
for the others, at compile time, allows them to remove dead code from
their system.
Diffstat (limited to 'src/wm_info_provider.rs')
| -rw-r--r-- | src/wm_info_provider.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs index 4c5e904..2beff89 100644 --- a/src/wm_info_provider.rs +++ b/src/wm_info_provider.rs @@ -12,13 +12,19 @@ use crate::state::State; mod dummy; pub use dummy::*; +#[cfg(feature = "river")] mod river; +#[cfg(feature = "river")] pub use river::*; +#[cfg(feature = "hyprland")] mod hyprland; +#[cfg(feature = "hyprland")] pub use hyprland::*; +#[cfg(feature = "niri")] mod niri; +#[cfg(feature = "niri")] pub use niri::*; pub trait WmInfoProvider: Any { @@ -49,14 +55,17 @@ pub trait WmInfoProvider: Any { } pub fn bind(conn: &mut Connection<State>, config: &WmConfig) -> Box<dyn WmInfoProvider> { + #[cfg(feature = "river")] if let Some(river) = RiverInfoProvider::bind(conn, config) { return Box::new(river); } + #[cfg(feature = "hyprland")] if let Some(hyprland) = HyprlandInfoProvider::new() { return Box::new(hyprland); } + #[cfg(feature = "niri")] if let Some(niri) = NiriInfoProvider::new() { return Box::new(niri); } |
