From 318fdf3b05fe5c630e5a9cfbd35617b636716ac2 Mon Sep 17 00:00:00 2001 From: Arthur Khachaturov Date: Thu, 19 Sep 2024 04:26:09 +0300 Subject: [PATCH] add some blocks --- blocks.h | 10 +++++----- dwmblocks.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blocks.h b/blocks.h index 14bb515..5c5dc16 100644 --- a/blocks.h +++ b/blocks.h @@ -1,9 +1,9 @@ static const Block blocks[] = { -// - {"", "sb-vpn", 30, 2}, - {"", "sb-cast", 30, 1}, - {"", "sb-battery", 5, 0}, - {"", "date +'%a %m/%d %I:%M %P'", 5, 0}, + {"", "sb-status", 30, 3}, + {"", "sb-cast", 30, 1}, + {"", "sb-vpn", 30, 2}, + {"", "sb-battery", 5, 0}, + {"", "date +'%a %m/%d %I:%M %P'", 5, 0}, }; static char delim[] = " | "; diff --git a/dwmblocks.c b/dwmblocks.c index 0f13f01..5403876 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -14,7 +14,7 @@ #define SIGMINUS SIGRTMIN #endif #define LENGTH(X) (sizeof(X) / sizeof (X[0])) -#define CMDLENGTH 50 +#define CMDLENGTH 512 #define MIN( a, b ) ( ( a < b) ? a : b ) #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 i = output[i-1] == '\n' ? i-1 : i; if (delim[0] != '\0') { - strncpy(output+i, delim, delimLen); + strncpy(output+i, delim, delimLen); } else output[i++] = '\0';