Several fixes, patched dwmblocks so it shows spaces around the bar

This commit is contained in:
2025-09-30 13:42:23 +02:00
parent a250278454
commit 3f399b5c0e
10 changed files with 90 additions and 22 deletions

View File

@@ -0,0 +1,33 @@
diff --git a/dwmblocks.c b/dwmblocks.c
index 3f7a1c2..f7a7c2e 100644
--- a/dwmblocks.c
+++ b/dwmblocks.c
@@ -165,10 +165,15 @@ void setroot()
{
- if (!getstatus(statusstr[0], statusstr[1]))//Only set root if text has changed.
- return;
- XStoreName(dpy, root, statusstr[0]);
- XFlush(dpy);
+ if (!getstatus(statusstr[0], statusstr[1])) // Only set root if text has changed.
+ return;
+
+ char outstr[STATUSLENGTH + 4];
+ snprintf(outstr, sizeof(outstr), " %s ", statusstr[0]);
+
+ XStoreName(dpy, root, outstr);
+ XFlush(dpy);
}
int setupX()
@@ -187,9 +192,13 @@ void pstdout()
{
- if (!getstatus(statusstr[0], statusstr[1]))//Only write out if text has changed.
- return;
- printf("%s\n",statusstr[0]);
- fflush(stdout);
+ if (!getstatus(statusstr[0], statusstr[1])) // Only write out if text has changed.
+ return;
+
+ printf(" %s \n", statusstr[0]);
+ fflush(stdout);
}