LemonBoy/bar

Reload "modules" on signal RTMIN

sampaio23 opened this issue · 1 comments

Hi!

Suppose I have a script in which I create some modules, like:

volume() { echo "something" }
clock() { echo "date +%H:%M:%S" }
ip4addr() { echo "something else" }

and I want to put them in my bar, like:

while true; do
    BAR_INPUT="$(ip4addr) | Volume: $(volume) | $(clock)"
    echo $BAR_INPUT
    sleep 1000
done

In this case:

  • volume() should only update when sending, for instance, a RTMIN signal, that is, when I change the volume;
  • clock() should update every second;
  • ip4addr(), for instance, should update every 10 seconds.

Is there a way to do this?

Thanks in advance! Best regards!

You could take a look at Captain for some advanced shell script that does just that.