diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2025-01-18 09:32:18 +0100 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2025-01-18 09:34:07 +0100 |
| commit | f73635159598119a67533fda394e49830506cd85 (patch) | |
| tree | 78f3c2b0052af68d4bdcd8b31e548af613d34814 /src/render.rs | |
| parent | chore: update cargo deps (diff) | |
| download | sl0pstatus-f73635159598119a67533fda394e49830506cd85.tar.gz sl0pstatus-f73635159598119a67533fda394e49830506cd85.tar.xz sl0pstatus-f73635159598119a67533fda394e49830506cd85.zip | |
feat: add pipe widget
Diffstat (limited to 'src/render.rs')
| -rw-r--r-- | src/render.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/render.rs b/src/render.rs index a9f55ef..6ef0005 100644 --- a/src/render.rs +++ b/src/render.rs @@ -205,6 +205,10 @@ impl FormattedPart { widget_key_name = "command"; } + if widget_key.starts_with("pipe_") { + widget_key_name = "pipe"; + } + let widget_mask = event_mask_from_widget_name(widget_key_name); let skip_widget_cache = widget_mask & UpdateEventMask::Always as u8 != 0; if !skip_widget_cache && widget_mask & state.cache_mask == 0 { @@ -278,6 +282,10 @@ fn cache_mask_from_content(content: &str) -> u8 { widget_key_name = "command"; } + if widget_key.starts_with("pipe_") { + widget_key_name = "pipe"; + } + output |= event_mask_from_widget_name(widget_key_name); } output @@ -304,10 +312,7 @@ fn parse_color(color: &str, config: &BTreeMap<String, String>) -> Option<Color> if color.starts_with('$') { let alias_name = color.strip_prefix('$').unwrap(); - color = match config.get(&format!("color_{alias_name}")) { - Some(color_str) => color_str, - None => return None, - }; + color = config.get(&format!("color_{alias_name}"))?; } if color.starts_with('#') { |
