Permalink
Browse files

updated

  • Loading branch information...
1 parent 673ccbc commit 05719048efb68a841c6a91c8acd2e7ff081a6705 OK committed Jul 5, 2012
File renamed without changes.
@@ -1,85 +0,0 @@
---- dwm.c.orig 2012-04-29 19:07:00.000000000 +0200
-+++ dwm.c 2012-04-29 19:07:40.237787666 +0200
-@@ -120,10 +120,15 @@ typedef struct {
- } Key;
-
- typedef struct {
-+ const char *icon;
- const char *symbol;
- void (*arrange)(Monitor *);
- } Layout;
-
-+typedef struct {
-+ const char *icon;
-+} MonocleNumberedIcon;
-+
- struct Monitor {
- char ltsymbol[16];
- int num;
-@@ -188,6 +193,7 @@ static void die(const char *errstr, ...)
- static Monitor *dirtomon(int dir);
- static void drawbar(Monitor *m);
- static void drawbars(void);
-+static void drawicon(const char *file, unsigned long col[ColLast]);
- static void drawcoloredtext(char *text);
- static void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
- static void drawtext(const char *text, unsigned long col[ColLast], Bool pad);
-@@ -750,7 +756,7 @@ dirtomon(int dir) {
- void
- drawbar(Monitor *m) {
- int x;
-- unsigned int i, occ = 0, urg = 0;
-+ unsigned int i, occ = 0, urg = 0, n = 0;
- unsigned long *col;
- Client *c;
-
-@@ -767,8 +773,26 @@ drawbar(Monitor *m) {
- drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, col);
- dc.x += dc.w;
- }
-- dc.w = blw = TEXTW(m->ltsymbol);
-- drawtext(m->ltsymbol, dc.colors[0], True);
-+ blw = TEXTW(m->ltsymbol);
-+
-+ if(useicons) {
-+ dc.w = dc.h;
-+ if(selmon->lt[selmon->sellt]->arrange == monocle) {
-+ for(c = m->clients; c; c = c->next)
-+ if(ISVISIBLE(c))
-+ n++;
-+ if(n < LENGTH(monoclenumberedicons))
-+ drawicon(monoclenumberedicons[n].icon, dc.colors[0]);
-+ else
-+ drawicon(m->lt[m->sellt]->icon, dc.colors[0]);
-+ }
-+ else
-+ drawicon(m->lt[m->sellt]->icon, dc.colors[0]);
-+ }
-+ else {
-+ dc.w = blw;
-+ drawtext(m->ltsymbol, dc.colors[0], False);
-+ }
- dc.x += dc.w;
- x = dc.x;
- if(m == selmon) { /* status is only drawn on selected monitor */
-@@ -835,6 +859,20 @@ drawcoloredtext(char *text) {
- }
-
- void
-+drawicon(const char *file, unsigned long col[ColLast]) {
-+ Pixmap icon;
-+ int px, py;
-+ unsigned int pw, ph;
-+ icon = XCreatePixmap(dpy, dc.drawable, dc.h, dc.h, 1);
-+ XReadBitmapFile(dpy, dc.drawable, file, &pw, &ph, &icon, &px, &py);
-+ XSetForeground(dpy, dc.gc, col[ColBG]);
-+ XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, 0, dc.h, dc.h);
-+ XSetForeground(dpy, dc.gc, col[ColFG]);
-+ XSetBackground(dpy, dc.gc, col[ColBG]);
-+ XCopyPlane(dpy, icon, dc.drawable, dc.gc, px, py, pw, ph, dc.x, dc.h/2-ph/2+py, 1);
-+}
-+
-+void
- drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
- int x;
- XSetForeground(dpy, dc.gc, col[ ColFG ]);
@@ -0,0 +1,11 @@
+--- dwm.c.orig 2012-07-05 20:08:33.000000000 +0200
++++ dwm.c 2012-07-05 20:10:09.478236977 +0200
+@@ -1270,7 +1270,7 @@ monocle(Monitor *m) {
+ if(n > 0) /* override layout symbol */
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
+- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
++ resize(c, m->wx - c->bw, m->wy - c->bw, m->ww, m->wh, False);
+ }
+
+ void
File renamed without changes.
@@ -1,25 +0,0 @@
---- dwm.c.o 2012-03-26 22:00:54.000000000 +0200
-+++ dwm.c 2012-03-26 22:05:38.809587732 +0200
-@@ -939,7 +939,8 @@ focus(Client *c) {
- detachstack(c);
- attachstack(c);
- grabbuttons(c, True);
-- XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
-+ if(c->mon->lt[c->mon->sellt]->arrange != monocle || c->isfloating)
-+ XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
- setfocus(c);
- }
- else
-@@ -1293,8 +1294,10 @@ monocle(Monitor *m) {
- n++;
- if(n > 0) /* override layout symbol */
- snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
-- for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
-- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
-+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
-+ resize(c, m->wx - c->bw, m->wy - c->bw, m->ww, m->wh, False);
-+ XSetWindowBorder(dpy, c->win, dc.colors[0][ColBG]);
-+ }
- }
-
- void
File renamed without changes.
View
@@ -0,0 +1,17 @@
+--- dwm.c.orig 2012-06-30 15:22:58.000000000 +0200
++++ dwm.c 2012-06-30 15:23:48.796615257 +0200
+@@ -788,13 +788,7 @@ drawbar(Monitor *m) {
+ dc.x = m->ww;
+ if((dc.w = dc.x - x) > bh) {
+ dc.x = x;
+- if(m->sel) {
+- col = m == selmon ? dc.colors[1] : dc.colors[0];
+- drawtext(m->sel->name, col, True);
+- drawsquare(m->sel->isfixed, m->sel->isfloating, col);
+- }
+- else
+- drawtext(NULL, dc.colors[0], False);
++ drawtext(NULL, dc.colors[0], False);
+ }
+ XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
+ XSync(dpy, False);
Oops, something went wrong.

0 comments on commit 0571904

Please sign in to comment.