From 448a0317fb7cdbd8ed4929e2da5fb4b88d507e07 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 27 Mar 2022 16:24:00 +0100 Subject: [PATCH] indicator for disk io: less than perfect, better than nothing --- blinkenlicht/bl.fnl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/blinkenlicht/bl.fnl b/blinkenlicht/bl.fnl index cd3652e..f6117d9 100644 --- a/blinkenlicht/bl.fnl +++ b/blinkenlicht/bl.fnl @@ -29,6 +29,19 @@ :classes ["hey"] :indicators [ + (let [] + (var previous 0) + ;; on my laptop, adding this indicator has made the task + ;; go from ~ 1% cpu to around 3%, which is not ideal + (indicator { + :wait-for { :interval (* 1 500) } + :refresh + #(let [current (. (metric.cpustat) :iowait) + v (if (< previous current) "" " ")] + (set previous current) + {:text v}) + })) + (let [f (io.open "/tmp/statuspipe" :r)] (fcntl.fcntl (posix.stdio.fileno f) fcntl.F_SETFL fcntl.O_NONBLOCK)