add some blocks
This commit is contained in:
parent
e7e5ed3f64
commit
318fdf3b05
2 changed files with 7 additions and 7 deletions
10
blocks.h
10
blocks.h
|
@ -1,9 +1,9 @@
|
||||||
static const Block blocks[] = {
|
static const Block blocks[] = {
|
||||||
// <i> <cmd> <int> <sig>
|
{"", "sb-status", 30, 3},
|
||||||
{"", "sb-vpn", 30, 2},
|
{"", "sb-cast", 30, 1},
|
||||||
{"", "sb-cast", 30, 1},
|
{"", "sb-vpn", 30, 2},
|
||||||
{"", "sb-battery", 5, 0},
|
{"", "sb-battery", 5, 0},
|
||||||
{"", "date +'%a %m/%d %I:%M %P'", 5, 0},
|
{"", "date +'%a %m/%d %I:%M %P'", 5, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static char delim[] = " | ";
|
static char delim[] = " | ";
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#define SIGMINUS SIGRTMIN
|
#define SIGMINUS SIGRTMIN
|
||||||
#endif
|
#endif
|
||||||
#define LENGTH(X) (sizeof(X) / sizeof (X[0]))
|
#define LENGTH(X) (sizeof(X) / sizeof (X[0]))
|
||||||
#define CMDLENGTH 50
|
#define CMDLENGTH 512
|
||||||
#define MIN( a, b ) ( ( a < b) ? a : b )
|
#define MIN( a, b ) ( ( a < b) ? a : b )
|
||||||
#define STATUSLENGTH (LENGTH(blocks) * CMDLENGTH + 1)
|
#define STATUSLENGTH (LENGTH(blocks) * CMDLENGTH + 1)
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ void getcmd(const Block *block, char *output)
|
||||||
//only chop off newline if one is present at the end
|
//only chop off newline if one is present at the end
|
||||||
i = output[i-1] == '\n' ? i-1 : i;
|
i = output[i-1] == '\n' ? i-1 : i;
|
||||||
if (delim[0] != '\0') {
|
if (delim[0] != '\0') {
|
||||||
strncpy(output+i, delim, delimLen);
|
strncpy(output+i, delim, delimLen);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
output[i++] = '\0';
|
output[i++] = '\0';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue