diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-08-31 22:35:27 +0200 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-08-31 22:35:27 +0200 |
| commit | ea771fca01837e6f6ee390189360205c0ac0f3ea (patch) | |
| tree | 7fc4ef8aa27ce8a706a36af1459c08759ebb7ef1 /src/render.rs | |
| parent | fix: crash on tab creation (diff) | |
| download | sl0pstatus-ea771fca01837e6f6ee390189360205c0ac0f3ea.tar.gz sl0pstatus-ea771fca01837e6f6ee390189360205c0ac0f3ea.tar.xz sl0pstatus-ea771fca01837e6f6ee390189360205c0ac0f3ea.zip | |
feat: add session plugin
Diffstat (limited to '')
| -rw-r--r-- | src/render.rs | 9 |
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), |
