summaryrefslogtreecommitdiff
path: root/src/wm_info_provider.rs
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-07-21 14:07:42 +0200
committercashmere <cashmere@autistici.org>2026-07-21 14:07:42 +0200
commit198f374a18b5c8a0e21f7d41125393aa89523f5c (patch)
treead8d32cc498b1b2715a5e71e5f438bf4bacfca53 /src/wm_info_provider.rs
parent85f0a9e875eee768766d7bdd24272d348f6b1e33 (diff)
downloadi3bar-mango-198f374a18b5c8a0e21f7d41125393aa89523f5c.tar.gz
mango: show focused window next to tags, fix mmsg lookup, 0.15.x compat
- new focused-window block ({icon} {app_id} - {title}) driven by the active_client field of mmsg watch all-monitors (mangowm >= 0.14) - resolve program icons via freedesktop icon themes/.desktop files (new icon module, cairo png feature, cached per app_id) - new show_focused_window config option (default true) - run mmsg from PATH instead of hardcoded /usr/bin/mmsg (broken on NixOS) - handle null active_client fields (no focused client) without failing to parse the whole event - drop stale TODO comment and unused variable in mango provider - add .justfile run recipe exporting MANGO_INSTANCE_SIGNATURE
Diffstat (limited to 'src/wm_info_provider.rs')
-rw-r--r--src/wm_info_provider.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs
index d598234..67e5f83 100644
--- a/src/wm_info_provider.rs
+++ b/src/wm_info_provider.rs
@@ -47,6 +47,9 @@ pub trait WmInfoProvider: Any {
fn get_mode_name(&self, _: &Output) -> Option<String> {
None
}
+ fn get_focused_window(&self, _: &Output) -> Option<FocusedWindow> {
+ None
+ }
fn click_on_tag(
&mut self,
@@ -83,6 +86,12 @@ pub fn bind(conn: &mut Connection<State>, config: &WmConfig) -> Box<dyn WmInfoPr
Box::new(DummyInfoProvider)
}
+#[derive(Debug, Clone, PartialEq)]
+pub struct FocusedWindow {
+ pub app_id: String,
+ pub title: String,
+}
+
#[derive(Debug)]
pub struct Tag {
pub id: u32,