aboutsummaryrefslogtreecommitdiffstats
path: root/src/pipe.rs
diff options
context:
space:
mode:
authorDaniel Jankowski <daniel.jankowski@rub.de>2025-01-18 09:32:18 +0100
committerDaniel Jankowski <daniel.jankowski@rub.de>2025-01-18 09:34:07 +0100
commitf73635159598119a67533fda394e49830506cd85 (patch)
tree78f3c2b0052af68d4bdcd8b31e548af613d34814 /src/pipe.rs
parentchore: update cargo deps (diff)
downloadsl0pstatus-f73635159598119a67533fda394e49830506cd85.tar.gz
sl0pstatus-f73635159598119a67533fda394e49830506cd85.tar.xz
sl0pstatus-f73635159598119a67533fda394e49830506cd85.zip
feat: add pipe widget
Diffstat (limited to 'src/pipe.rs')
-rw-r--r--src/pipe.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pipe.rs b/src/pipe.rs
index f88db89..38fea5d 100644
--- a/src/pipe.rs
+++ b/src/pipe.rs
@@ -67,12 +67,28 @@ fn process_line(state: &mut ZellijState, line: &str) -> bool {
should_render = true;
}
+ "pipe" => {
+ if parts.len() < 4 {
+ return false;
+ }
+
+ pipe(state, parts[2], parts[3]);
+
+ should_render = true;
+ }
_ => {}
}
should_render
}
+fn pipe(state: &mut ZellijState, name: &str, content: &str) {
+ tracing::debug!("saving pipe result {name} {content}");
+ state
+ .pipe_results
+ .insert(name.to_owned(), content.to_owned());
+}
+
fn notify(state: &mut ZellijState, message: &str) {
state.incoming_notification = Some(notification::Message {
body: message.to_string(),