diff options
| author | cashmere <cashmere@autistici.org> | 2026-07-21 14:07:42 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-07-21 14:07:42 +0200 |
| commit | 198f374a18b5c8a0e21f7d41125393aa89523f5c (patch) | |
| tree | ad8d32cc498b1b2715a5e71e5f438bf4bacfca53 /src/state.rs | |
| parent | 85f0a9e875eee768766d7bdd24272d348f6b1e33 (diff) | |
| download | i3bar-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/state.rs')
| -rw-r--r-- | src/state.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs index 263f38c..ccd0d52 100644 --- a/src/state.rs +++ b/src/state.rs @@ -103,6 +103,7 @@ impl State { config, status_cmd, blocks_cache: BlocksCache::default(), + icon_cache: Default::default(), wm_info_provider, }, @@ -160,6 +161,11 @@ impl State { let mut bar = Bar::new(conn, self, output); bar.set_tags(self.shared_state.wm_info_provider.get_tags(&bar.output)); + bar.set_focused_window( + self.shared_state + .wm_info_provider + .get_focused_window(&bar.output), + ); if !self.hidden { bar.show(conn, &self.shared_state); @@ -221,6 +227,13 @@ impl State { }); } + pub fn focused_window_updated(&mut self, conn: &mut Connection<Self>, output: Option<WlOutput>) { + self.for_each_bar(output, |bar, ss| { + bar.set_focused_window(ss.wm_info_provider.get_focused_window(&bar.output)); + bar.frame(conn, ss); + }); + } + pub fn mode_name_updated(&mut self, conn: &mut Connection<Self>, output: Option<WlOutput>) { self.for_each_bar(output, |bar, ss| { bar.set_mode_name(ss.wm_info_provider.get_mode_name(&bar.output)); |
