|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
From 7cb619b3e5e94405bb4719661064e0ab6386855a Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 15d27250cc3b1b34df8116052f5608a3be3388b8 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: bakkeby <bakkeby@gmail.com>
|
|
|
|
|
Date: Mon, 20 Jul 2020 15:17:52 +0200
|
|
|
|
|
Subject: [PATCH 2/2] Adding status2d + statuscmd + dwmblocks + extrastatus
|
|
|
|
@ -6,16 +6,16 @@ Subject: [PATCH 2/2] Adding status2d + statuscmd + dwmblocks + extrastatus
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
config.def.h | 11 ++-
|
|
|
|
|
dwm.c | 22 +++++-
|
|
|
|
|
dwm.c | 23 +++++-
|
|
|
|
|
patch/bar_dwmblocks.c | 31 ++++++++
|
|
|
|
|
patch/bar_dwmblocks.h | 2 +
|
|
|
|
|
patch/bar_status2d.c | 167 ++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
patch/bar_status2d.c | 171 ++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
patch/bar_status2d.h | 6 ++
|
|
|
|
|
patch/bar_statuscmd.c | 49 +++++++++++++
|
|
|
|
|
patch/bar_statuscmd.c | 49 ++++++++++++
|
|
|
|
|
patch/bar_statuscmd.h | 4 +
|
|
|
|
|
patch/include.c | 7 +-
|
|
|
|
|
patch/include.h | 7 +-
|
|
|
|
|
10 files changed, 296 insertions(+), 10 deletions(-)
|
|
|
|
|
10 files changed, 301 insertions(+), 10 deletions(-)
|
|
|
|
|
create mode 100644 patch/bar_dwmblocks.c
|
|
|
|
|
create mode 100644 patch/bar_dwmblocks.h
|
|
|
|
|
create mode 100644 patch/bar_status2d.c
|
|
|
|
@ -61,7 +61,7 @@ index 2534eac..40541cb 100644
|
|
|
|
|
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
|
|
|
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
|
|
|
|
diff --git a/dwm.c b/dwm.c
|
|
|
|
|
index 03dccfb..030c8a3 100644
|
|
|
|
|
index 03dccfb..1e60958 100644
|
|
|
|
|
--- a/dwm.c
|
|
|
|
|
+++ b/dwm.c
|
|
|
|
|
@@ -289,7 +289,10 @@ static void zoom(const Arg *arg);
|
|
|
|
@ -85,16 +85,17 @@ index 03dccfb..030c8a3 100644
|
|
|
|
|
free(scheme[i]);
|
|
|
|
|
XDestroyWindow(dpy, wmcheckwin);
|
|
|
|
|
drw_free(drw);
|
|
|
|
|
@@ -1726,7 +1729,7 @@ setup(void)
|
|
|
|
|
@@ -1726,7 +1729,8 @@ setup(void)
|
|
|
|
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
|
|
|
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
|
|
|
|
/* init appearance */
|
|
|
|
|
- scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
|
|
|
|
|
+ scheme = ecalloc(LENGTH(colors) + 1, sizeof(Clr *));
|
|
|
|
|
+ scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3);
|
|
|
|
|
for (i = 0; i < LENGTH(colors); i++)
|
|
|
|
|
scheme[i] = drw_scm_create(drw, colors[i], 3);
|
|
|
|
|
/* init bars */
|
|
|
|
|
@@ -2169,8 +2172,19 @@ void
|
|
|
|
|
@@ -2169,8 +2173,19 @@ void
|
|
|
|
|
updatestatus(void)
|
|
|
|
|
{
|
|
|
|
|
Monitor *m;
|
|
|
|
@ -164,10 +165,10 @@ index 0000000..f08f1d5
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
diff --git a/patch/bar_status2d.c b/patch/bar_status2d.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..cdeaca5
|
|
|
|
|
index 0000000..6111a51
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/patch/bar_status2d.c
|
|
|
|
|
@@ -0,0 +1,167 @@
|
|
|
|
|
@@ -0,0 +1,171 @@
|
|
|
|
|
+int
|
|
|
|
|
+width_status2d(Bar *bar, BarWidthArg *a)
|
|
|
|
|
+{
|
|
|
|
@ -200,11 +201,12 @@ index 0000000..cdeaca5
|
|
|
|
|
+ char *text;
|
|
|
|
|
+ char *p;
|
|
|
|
|
+
|
|
|
|
|
+ len = strlen(stext) + 1;
|
|
|
|
|
+ if (!(text = (char*) malloc(sizeof(char)*len)))
|
|
|
|
|
+ len = strlen(stext);
|
|
|
|
|
+ if (!(text = (char*) malloc(sizeof(char)*(len + 1))))
|
|
|
|
|
+ die("malloc");
|
|
|
|
|
+ p = text;
|
|
|
|
|
+ copyvalidchars(text, stext);
|
|
|
|
|
+ text[len] = '\0';
|
|
|
|
|
+
|
|
|
|
|
+ x += lrpad / 2;
|
|
|
|
|
+ drw_setscheme(drw, scheme[LENGTH(colors)]);
|
|
|
|
@ -227,8 +229,9 @@ index 0000000..cdeaca5
|
|
|
|
|
+ while (text[++i] != '^') {
|
|
|
|
|
+ if (text[i] == 'c') {
|
|
|
|
|
+ char buf[8];
|
|
|
|
|
+ if (i + 7 > len) {
|
|
|
|
|
+ if (i + 7 > len - 1) {
|
|
|
|
|
+ i += 7;
|
|
|
|
|
+ len = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ memcpy(buf, (char*)text+i+1, 7);
|
|
|
|
@ -243,8 +246,9 @@ index 0000000..cdeaca5
|
|
|
|
|
+ i += 7;
|
|
|
|
|
+ } else if (text[i] == 'b') {
|
|
|
|
|
+ char buf[8];
|
|
|
|
|
+ if (i + 7 > len) {
|
|
|
|
|
+ if (i + 7 > len - 1) {
|
|
|
|
|
+ i += 7;
|
|
|
|
|
+ len = 0;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ memcpy(buf, (char*)text+i+1, 7);
|
|
|
|
@ -281,11 +285,12 @@ index 0000000..cdeaca5
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ text = text + i + 1;
|
|
|
|
|
+ len -= i + 1;
|
|
|
|
|
+ i=-1;
|
|
|
|
|
+ isCode = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!isCode) {
|
|
|
|
|
+ if (!isCode && len) {
|
|
|
|
|
+ w = TEXTW(text) - lrpad;
|
|
|
|
|
+ drw_text(drw, x, 0, w, bh, 0, text, 0);
|
|
|
|
|
+ x += w;
|
|
|
|
|