sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 5ef18d7e3623b4041a469ddae6556e11a32babd9
parent ec59646f18077c0d612bed90bf394a157dd728e2
Author: Mate Nagy <mnagy@port70.net>
Date:   Tue, 22 Sep 2009 12:47:53 +0200

added updated version of fancybar patch
Diffstat:
Ddwm.suckless.org/patches/fancybar-r1483.diff | 121-------------------------------------------------------------------------------
Adwm.suckless.org/patches/fancybar-r1496.diff | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/fancybar.md | 4++--
3 files changed, 128 insertions(+), 123 deletions(-)

diff --git a/dwm.suckless.org/patches/fancybar-r1483.diff b/dwm.suckless.org/patches/fancybar-r1483.diff @@ -1,121 +0,0 @@ -diff -r 63e19dad219c dwm.c ---- a/dwm.c Tue Aug 18 15:59:38 2009 +0100 -+++ b/dwm.c Mon Aug 24 18:29:24 2009 +0200 -@@ -169,6 +169,7 @@ - static Monitor *dirtomon(int dir); - static void drawbar(Monitor *m); - static void drawbars(void); -+static void drawvline(unsigned long col[ColLast]); - static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]); - static void drawtext(const char *text, unsigned long col[ColLast], Bool invert); - static void enternotify(XEvent *e); -@@ -648,10 +649,11 @@ - - void - drawbar(Monitor *m) { -- int x; -+ int x, ow, mw = 0, extra, tw; - unsigned int i, n = 0, occ = 0, urg = 0; - unsigned long *col; -- Client *c; -+ Client *c, *firstvis, *lastvis = NULL; -+ DC seldc; - - for(c = m->clients; c; c = c->next) { - if(ISVISIBLE(c)) -@@ -689,16 +691,62 @@ - } - else - dc.x = m->ww; -- if((dc.w = dc.x - x) > bh) { -- dc.x = x; -- if(m->sel) { -- col = m == selmon ? dc.sel : dc.norm; -- drawtext(m->sel->name, col, False); -- drawsquare(m->sel->isfixed, m->sel->isfloating, False, col); -+ -+ for(c = m->clients; c && !ISVISIBLE(c); c = c->next); -+ firstvis = c; -+ -+ col = m == selmon ? dc.sel : dc.norm; -+ dc.w = dc.x - x; -+ dc.x = x; -+ -+ if(n > 0) { -+ mw = dc.w / n; -+ extra = 0; -+ seldc = dc; -+ i = 0; -+ -+ while(c) { -+ lastvis = c; -+ tw = TEXTW(c->name); -+ if(tw < mw) extra += (mw - tw); else i++; -+ for(c = c->next; c && !ISVISIBLE(c); c = c->next); - } -- else -+ -+ if(i > 0) mw += extra / i; -+ -+ c = firstvis; -+ x = dc.x; -+ } -+ -+ while(dc.w > bh) { -+ if(c) { -+ ow = dc.w; -+ tw = TEXTW(c->name); -+ dc.w = MIN(ow, tw); -+ -+ if(dc.w > mw) dc.w = mw; -+ if(m->sel == c) seldc = dc; -+ if(c == lastvis) dc.w = ow; -+ -+ drawtext(c->name, col, False); -+ if(c != firstvis) drawvline(col); -+ drawsquare(c->isfixed, c->isfloating, False, col); -+ -+ dc.x += dc.w; -+ dc.w = ow - dc.w; -+ for(c = c->next; c && !ISVISIBLE(c); c = c->next); -+ } else { - drawtext(NULL, dc.norm, False); -+ break; -+ } - } -+ -+ if(m == selmon && m->sel && ISVISIBLE(m->sel)) { -+ dc = seldc; -+ drawtext(m->sel->name, col, True); -+ drawsquare(m->sel->isfixed, m->sel->isfloating, True, col); -+ } -+ - XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0); - XSync(dpy, False); - } -@@ -709,6 +757,15 @@ - - for(m = mons; m; m = m->next) - drawbar(m); -+} -+ -+void -+drawvline(unsigned long col[ColLast]) { -+ XGCValues gcv; -+ -+ gcv.foreground = col[ColFG]; -+ XChangeGC(dpy, dc.gc, GCForeground, &gcv); -+ XDrawLine(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.x, dc.y + (dc.font.ascent + dc.font.descent + 2)); - } - - void -@@ -1235,8 +1292,7 @@ - } - if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); -- if(c == c->mon->sel) -- drawbar(c->mon); -+ drawbar(c->mon); - } - } - } diff --git a/dwm.suckless.org/patches/fancybar-r1496.diff b/dwm.suckless.org/patches/fancybar-r1496.diff @@ -0,0 +1,126 @@ +diff -r de4a2998e1f5 dwm.c +--- a/dwm.c Tue Sep 22 09:53:11 2009 +0100 ++++ b/dwm.c Tue Sep 22 12:32:15 2009 +0200 +@@ -171,6 +171,7 @@ + static Monitor *dirtomon(int dir); + static void drawbar(Monitor *m); + static void drawbars(void); ++static void drawvline(unsigned long col[ColLast]); + static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]); + static void drawtext(const char *text, unsigned long col[ColLast], Bool invert); + static void enternotify(XEvent *e); +@@ -668,12 +669,15 @@ + + void + drawbar(Monitor *m) { +- int x; +- unsigned int i, occ = 0, urg = 0; ++ int x, ow, mw = 0, extra, tw; ++ unsigned int i, n = 0, occ = 0, urg = 0; + unsigned long *col; +- Client *c; ++ Client *c, *firstvis, *lastvis = NULL; ++ DC seldc; + + for(c = m->clients; c; c = c->next) { ++ if(ISVISIBLE(c)) ++ n++; + occ |= c->tags; + if(c->isurgent) + urg |= c->tags; +@@ -702,16 +706,62 @@ + } + else + dc.x = m->ww; +- if((dc.w = dc.x - x) > bh) { +- dc.x = x; +- if(m->sel) { +- col = m == selmon ? dc.sel : dc.norm; +- drawtext(m->sel->name, col, False); +- drawsquare(m->sel->isfixed, m->sel->isfloating, False, col); ++ ++ for(c = m->clients; c && !ISVISIBLE(c); c = c->next); ++ firstvis = c; ++ ++ col = m == selmon ? dc.sel : dc.norm; ++ dc.w = dc.x - x; ++ dc.x = x; ++ ++ if(n > 0) { ++ mw = dc.w / n; ++ extra = 0; ++ seldc = dc; ++ i = 0; ++ ++ while(c) { ++ lastvis = c; ++ tw = TEXTW(c->name); ++ if(tw < mw) extra += (mw - tw); else i++; ++ for(c = c->next; c && !ISVISIBLE(c); c = c->next); + } +- else ++ ++ if(i > 0) mw += extra / i; ++ ++ c = firstvis; ++ x = dc.x; ++ } ++ ++ while(dc.w > bh) { ++ if(c) { ++ ow = dc.w; ++ tw = TEXTW(c->name); ++ dc.w = MIN(ow, tw); ++ ++ if(dc.w > mw) dc.w = mw; ++ if(m->sel == c) seldc = dc; ++ if(c == lastvis) dc.w = ow; ++ ++ drawtext(c->name, col, False); ++ if(c != firstvis) drawvline(col); ++ drawsquare(c->isfixed, c->isfloating, False, col); ++ ++ dc.x += dc.w; ++ dc.w = ow - dc.w; ++ for(c = c->next; c && !ISVISIBLE(c); c = c->next); ++ } else { + drawtext(NULL, dc.norm, False); ++ break; ++ } + } ++ ++ if(m == selmon && m->sel && ISVISIBLE(m->sel)) { ++ dc = seldc; ++ drawtext(m->sel->name, col, True); ++ drawsquare(m->sel->isfixed, m->sel->isfloating, True, col); ++ } ++ + XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0); + XSync(dpy, False); + } +@@ -725,6 +775,15 @@ + } + + void ++drawvline(unsigned long col[ColLast]) { ++ XGCValues gcv; ++ ++ gcv.foreground = col[ColFG]; ++ XChangeGC(dpy, dc.gc, GCForeground, &gcv); ++ XDrawLine(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.x, dc.y + (dc.font.ascent + dc.font.descent + 2)); ++} ++ ++void + drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) { + int x; + XGCValues gcv; +@@ -1274,8 +1333,7 @@ + } + if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { + updatetitle(c); +- if(c == c->mon->sel) +- drawbar(c->mon); ++ drawbar(c->mon); + } + } + } diff --git a/dwm.suckless.org/patches/fancybar.md b/dwm.suckless.org/patches/fancybar.md @@ -12,8 +12,8 @@ fit, they're cropped. The title of the selected window is inverted. ## Download - * [fancybar-5.6.1.diff](fancybar-5.6.1.diff) (2.8K) (20090824) - * [fancybar-r1483.diff](fancybar-r1483.diff) (2.8K) (20090824) + * [fancybar-5.6.1.diff](fancybar-5.6.1.diff) (dwm 5.6.1) (20090824) + * [fancybar-r1496.diff](fancybar-r1496.diff) (dwm 5.7) (20090922) ## Author