[wiki] [sites] [dwm] Update status2d patch for HEAD: bb3bd6f || lhark

From: <git_AT_suckless.org>
Date: Sat, 31 Dec 2016 09:24:33 +0100

commit ff50fbe7f2a5f821d7e73cffc053b0811ee0b99c
Author: lhark <lhark_AT_ntymail.com>
Date: Sat Dec 31 03:24:07 2016 -0500

    [dwm] Update status2d patch for HEAD: bb3bd6f

diff --git a/dwm.suckless.org/patches/dwm-status2d-20161231-bb3bd6f.diff b/dwm.suckless.org/patches/dwm-status2d-20161231-bb3bd6f.diff
new file mode 100644
index 0000000..e9b966e
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-status2d-20161231-bb3bd6f.diff
_AT_@ -0,0 +1,158 @@
+diff --git a/dwm.c b/dwm.c
+index d27cb67..464c9d6 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -163,6 +163,7 @@ static void detach(Client *c);
+ static void detachstack(Client *c);
+ static Monitor *dirtomon(int dir);
+ static void drawbar(Monitor *m);
++static int drawstatusbar(Monitor *m, int bh, char* text);
+ static void drawbars(void);
+ static void enternotify(XEvent *e);
+ static void expose(XEvent *e);
+_AT_@ -237,7 +238,7 @@ static void zoom(const Arg *arg);
+
+ /* variables */
+ static const char broken[] = "broken";
+-static char stext[256];
++static char stext[1024];
+ static int screen;
+ static int sw, sh; /* X display screen geometry width, height */
+ static int bh, blw = 0; /* bar geometry */
+_AT_@ -483,7 +484,7 @@ cleanup(void)
+ cleanupmon(mons);
+ for (i = 0; i < CurLast; i++)
+ drw_cur_free(drw, cursor[i]);
+- for (i = 0; i < LENGTH(colors); i++)
++ for (i = 0; i < LENGTH(colors) + 1; i++)
+ free(scheme[i]);
+ XDestroyWindow(dpy, wmcheckwin);
+ drw_free(drw);
+_AT_@ -690,6 +691,106 @@ dirtomon(int dir)
+ return m;
+ }
+
++int
++drawstatusbar(Monitor *m, int bh, char* stext) {
++ int ret, i, w, x, len;
++ short isCode = 0;
++ char *text;
++ char *p;
++
++ len = strlen(stext) + 1 ;
++ if (!(text = (char*) malloc(sizeof(char)*len)))
++ die("malloc");
++ p = text;
++ memcpy(text, stext, len);
++
++ /* compute width of the status text */
++ w = 0;
++ i = -1;
++ while (text[++i]) {
++ if (text[i] == '^') {
++ if (!isCode) {
++ isCode = 1;
++ text[i] = '
Received on Sat Dec 31 2016 - 09:24:33 CET

This archive was generated by hypermail 2.3.0 : Sat Dec 31 2016 - 09:36:16 CET