From 85f837ae706d6f64769597158a39c49259c8b189 Mon Sep 17 00:00:00 2001 From: Max Verevkin <34583604+MaxVerevkin@users.noreply.github.com> Date: Sat, 26 Aug 2023 17:19:29 +0300 Subject: show current mode on river (can be turned off) (#15) --- src/state.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/state.rs') 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, output: Option) { + 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 { -- cgit v1.3.1