summaryrefslogtreecommitdiff
path: root/src/shared_state.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-05-19 15:53:47 +0000
committerGitHub <noreply@github.com>2025-05-19 18:53:47 +0300
commit73446cac559b10adf4beb5567a816d1be5273457 (patch)
tree214aaa0c32d79c0184406e7a4abd7618c5f275fe /src/shared_state.rs
parentc9cee90d765198cf72c5a5155ee0d8ab566d98a9 (diff)
downloadi3bar-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/shared_state.rs')
-rw-r--r--src/shared_state.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared_state.rs b/src/shared_state.rs
index 169107b..015fa08 100644
--- a/src/shared_state.rs
+++ b/src/shared_state.rs
@@ -22,14 +22,17 @@ impl SharedState {
<dyn Any>::downcast_mut(self.wm_info_provider.as_mut())
}
+ #[cfg(feature = "river")]
pub fn get_river(&mut self) -> Option<&mut wm_info_provider::RiverInfoProvider> {
self.downcast_provider()
}
+ #[cfg(feature = "hyprland")]
pub fn get_hyprland(&mut self) -> Option<&mut wm_info_provider::HyprlandInfoProvider> {
self.downcast_provider()
}
+ #[cfg(feature = "niri")]
pub fn get_niri(&mut self) -> Option<&mut wm_info_provider::NiriInfoProvider> {
self.downcast_provider()
}