Here is a minimal example, with one block updating via an interval and another
via signal -
diff --git a/blocks.def.h b/blocks.def.h
index 9c22d68..d03866b 100644
--- a/blocks.def.h
@@ -1,9 +1,9 @@
//Modify this file to change what commands output to your statusbar, and recompile using the make command.
static const Block blocks[] = {
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
- {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
+ {"", "date '+%b %d (%a) %I:%M:%S %p'", 5, 0},
- {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
+ {"", "date '+%S'; sleep 2; pkill -SIGRTMIN+10 someblocks", 0, 10},
};
//sets delimeter between status commands. NULL character ('\0') means no delimeter.
---------------
The first block does not update.
And another with two blocks updating via signal -
diff --git a/blocks.def.h b/blocks.def.h
index 9c22d68..a6ec0c6 100644
--- a/blocks.def.h
@@ -1,9 +1,9 @@
//Modify this file to change what commands output to your statusbar, and recompile using the make command.
static const Block blocks[] = {
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
- {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
+ {"B1:", "date '+%S'; sleep 1; pkill -SIGRTMIN+10 someblocks", 0, 10},
- {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
+ {"B2", "date '+%S'; sleep 1; pkill -SIGRTMIN+11 someblocks", 0, 11},
};
//sets delimeter between status commands. NULL character ('\0') means no delimeter.
-------------
The second block is not even visible here
It works for me
blocks.h:
>//Modify this file to change what commands output to your statusbar, and recompile using the make command.
>static const Block blocks[] = {
> /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
> {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 3, 0},
>
>
> {"", "date '+%b %d (%a) %I:%M%p'", 15, 0},
>
> {"💾 ", "df -h | grep '/' -w | awk '{ print $3 \"iB/\"$2 \"iB\"}'", 120, 0},
>
> {"", "~/.local/bin/volume.sh", 0, 10},
>};
>
>//sets delimeter between status commands. NULL character ('\0') means no delimeter.
>static char delim[] = " | ";
>static unsigned int delimLen = 5;
(~/.local/bin/volume.sh displays the volume)
when I run
> pkill -SIGRTMIN+10 someblocks
It has the expected behaviour of updating the volume shown.
In addition my RAM is updated in accordance to the update interval (as
expected)
It could be because you're sending the signal from inside the command