summaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
authorMax Verevkin <34583604+MaxVerevkin@users.noreply.github.com>2023-08-26 17:19:29 +0300
committerGitHub <noreply@github.com>2023-08-26 17:19:29 +0300
commit85f837ae706d6f64769597158a39c49259c8b189 (patch)
treecc3c58c9fdfc42454e85b98372bb9ab5eb496e24 /src/state.rs
parent6aeb76407a30309326a04b29d19e5390a4b96248 (diff)
downloadi3bar-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.rs14
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 {