diff options
| author | Max Verevkin <34583604+MaxVerevkin@users.noreply.github.com> | 2023-08-26 17:19:29 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-26 17:19:29 +0300 |
| commit | 85f837ae706d6f64769597158a39c49259c8b189 (patch) | |
| tree | cc3c58c9fdfc42454e85b98372bb9ab5eb496e24 /src/state.rs | |
| parent | 6aeb76407a30309326a04b29d19e5390a4b96248 (diff) | |
| download | i3bar-mango-85f837ae706d6f64769597158a39c49259c8b189.tar.gz | |
show current mode on river (can be turned off) (#15)
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs index 3ace244..3a8eada 100644 --- a/src/state.rs +++ b/src/state.rs @@ -182,9 +182,11 @@ impl State { blocks_btns: Default::default(), tags: Vec::new(), layout_name: None, + mode_name: None, tags_btns: Default::default(), tags_computed: Vec::new(), layout_name_computed: None, + mode_computed: None, }; if !self.hidden { @@ -258,6 +260,18 @@ impl State { bar.request_frame(conn); }); } + + 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 + .as_mut() + .unwrap() + .get_mode_name(bar.output.wl), + ); + bar.request_frame(conn); + }); + } } impl SeatHandler for State { |
