aboutsummaryrefslogtreecommitdiffstats
path: root/src/render.rs
diff options
context:
space:
mode:
authorDaniel Jankowski <daniel.jankowski@rub.de>2023-08-31 22:35:27 +0200
committerDaniel Jankowski <daniel.jankowski@rub.de>2023-08-31 22:35:27 +0200
commitea771fca01837e6f6ee390189360205c0ac0f3ea (patch)
tree7fc4ef8aa27ce8a706a36af1459c08759ebb7ef1 /src/render.rs
parentfix: crash on tab creation (diff)
downloadsl0pstatus-ea771fca01837e6f6ee390189360205c0ac0f3ea.tar.gz
sl0pstatus-ea771fca01837e6f6ee390189360205c0ac0f3ea.tar.xz
sl0pstatus-ea771fca01837e6f6ee390189360205c0ac0f3ea.zip
feat: add session plugin
Diffstat (limited to '')
-rw-r--r--src/render.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/render.rs b/src/render.rs
index 287c00d..279b458 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -44,6 +44,15 @@ pub fn widgets_and_formatting(
output = output.replace("{mode}", &result);
}
+ if output.contains("{session}") {
+ let result = match widgets.get("session") {
+ Some(widget) => widget.process(state.clone()),
+ None => "Use of uninitialized widget".to_string(),
+ };
+
+ output = output.replace("{session}", &result);
+ }
+
if output.contains("{tabs}") {
let result = match widgets.get("tabs") {
Some(widget) => widget.process(state),