From 01e9f1a5686c780e387398ceb330f1ee7dfdf2d0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 22 Apr 2020 20:09:51 -0400 Subject: Revert "no longer (unused) icon slot" for bugfix This reverts commit 29485b43b0712062a0ccb99a1301ef071252a95e. --- dwmblocks.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dwmblocks.c') diff --git a/dwmblocks.c b/dwmblocks.c index 7d7a564..0cd0b54 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -8,6 +8,7 @@ #define CMDLENGTH 50 typedef struct { + char* icon; char* command; unsigned int interval; unsigned int signal; @@ -55,6 +56,7 @@ void getcmd(const Block *block, char *output) output[0] = block->signal; output++; } + strcpy(output, block->icon); char* cmd; FILE *cmdf; if (button) @@ -72,8 +74,10 @@ void getcmd(const Block *block, char *output) } if (!cmdf) return; - fgets(output, CMDLENGTH, cmdf); - int i = strlen(output); + char c; + int i = strlen(block->icon); + fgets(output+i, CMDLENGTH-i, cmdf); + i = strlen(output); if (delim != '\0' && i) output[i++] = delim; output[i++] = '\0'; -- cgit v1.2.3