Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added systray, statuscolors patches

  • Loading branch information...
commit b5bcb5c8cfa8f4c779553a39e5235572b1c020b7 1 parent 17d4628
OK authored
View
197 01-dwm-6.0-statuscolors.diff
@@ -0,0 +1,197 @@
+--- dwm-5.9/dwm.c 2011-07-10 16:24:25.000000000 -0400
++++ dwm-5.9-colors/dwm.c 2011-08-18 02:07:20.788935100 -0400
+@@ -48,6 +48,7 @@
+ #define LENGTH(X) (sizeof X / sizeof X[0])
+ #define MAX(A, B) ((A) > (B) ? (A) : (B))
+ #define MIN(A, B) ((A) < (B) ? (A) : (B))
++#define MAXCOLORS 8
+ #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
+ #define WIDTH(X) ((X)->w + 2 * (X)->bw)
+ #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
+@@ -97,9 +98,8 @@ struct Client {
+
+ typedef struct {
+ int x, y, w, h;
+- unsigned long norm[ColLast];
+- unsigned long sel[ColLast];
+- Drawable drawable;
++ unsigned long colors[MAXCOLORS][ColLast];
++ Drawable drawable;
+ GC gc;
+ struct {
+ int ascent;
+@@ -175,8 +175,9 @@ static void die(const char *errstr, ...)
+ static Monitor *dirtomon(int dir);
+ static void drawbar(Monitor *m);
+ static void drawbars(void);
+-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 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);
+ static void enternotify(XEvent *e);
+ static void expose(XEvent *e);
+ static void focus(Client *c);
+@@ -736,14 +737,13 @@ drawbar(Monitor *m) {
+ dc.x = 0;
+ for(i = 0; i < LENGTH(tags); i++) {
+ dc.w = TEXTW(tags[i]);
+- col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
+- drawtext(tags[i], col, urg & 1 << i);
+- drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+- occ & 1 << i, urg & 1 << i, col);
++ col = dc.colors[ (m->tagset[m->seltags] & 1 << i ? 1:(urg & 1 << i ? 2:0))];
++ drawtext(tags[i], col, True);
++ 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.norm, False);
++ drawtext(m->ltsymbol, dc.colors[0], True);
+ dc.x += dc.w;
+ x = dc.x;
+ if(m == selmon) { /* status is only drawn on selected monitor */
+@@ -753,19 +753,19 @@ drawbar(Monitor *m) {
+ dc.x = x;
+ dc.w = m->ww - x;
+ }
+- drawtext(stext, dc.norm, False);
++ drawcoloredtext(stext);
+ }
+ 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);
++ 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.norm, 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);
+@@ -780,10 +780,39 @@ drawbars(void) {
+ }
+
+ void
+-drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
+- int x;
++drawcoloredtext(char *text) {
++ Bool first=True;
++ char *buf = text, *ptr = buf, c = 1;
++ unsigned long *col = dc.colors[0];
++ int i, ox = dc.x;
++
++ while( *ptr ) {
++ for( i = 0; *ptr < 0 || *ptr > NUMCOLORS; i++, ptr++);
++ if( !*ptr ) break;
++ c=*ptr;
++ *ptr=0;
++ if( i ) {
++ dc.w = selmon->ww - dc.x;
++ drawtext(buf, col, first);
++ dc.x += textnw(buf, i) + textnw(&c,1);
++ if( first ) dc.x += ( dc.font.ascent + dc.font.descent ) / 2;
++ first = False;
++ } else if( first ) {
++ ox = dc.x += textnw(&c,1);
++ }
++ *ptr = c;
++ col = dc.colors[ c-1 ];
++ buf = ++ptr;
++ }
++ if( !first ) dc.x-=(dc.font.ascent+dc.font.descent)/2;
++ drawtext(buf, col, True);
++ dc.x = ox;
++}
+
+- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
++void
++drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
++ int x;
++ XSetForeground(dpy, dc.gc, col[ ColFG ]);
+ x = (dc.font.ascent + dc.font.descent + 2) / 4;
+ if(filled)
+ XFillRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x+1, x+1);
+@@ -792,17 +821,17 @@ drawsquare(Bool filled, Bool empty, Bool
+ }
+
+ void
+-drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
++drawtext(const char *text, unsigned long col[ColLast], Bool pad) {
+ char buf[256];
+ int i, x, y, h, len, olen;
+
+- XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
++ XSetForeground(dpy, dc.gc, col[ ColBG ]);
+ XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
+ if(!text)
+ return;
+ olen = strlen(text);
+- h = dc.font.ascent + dc.font.descent;
+- y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
++ h = pad ? (dc.font.ascent + dc.font.descent) : 0;
++ y = dc.y + ((dc.h + dc.font.ascent - dc.font.descent) / 2);
+ x = dc.x + (h / 2);
+ /* shorten text if necessary */
+ for(len = MIN(olen, sizeof buf); len && textnw(text, len) > dc.w - h; len--);
+@@ -811,7 +840,7 @@ drawtext(const char *text, unsigned long
+ memcpy(buf, text, len);
+ if(len < olen)
+ for(i = len; i && i > len - 3; buf[--i] = '.');
+- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
++ XSetForeground(dpy, dc.gc, col[ ColFG ]);
+ if(dc.font.set)
+ XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
+ else
+@@ -861,7 +890,7 @@ focus(Client *c) {
+ detachstack(c);
+ attachstack(c);
+ grabbuttons(c, True);
+- XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
++ XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
+ setfocus(c);
+ }
+ else
+@@ -1137,7 +1166,7 @@ manage(Window w, XWindowAttributes *wa)
+ }
+ wc.border_width = c->bw;
+ XConfigureWindow(dpy, w, CWBorderWidth, &wc);
+- XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
++ XSetWindowBorder(dpy, w, dc.colors[0][ColBorder]);
+ configure(c); /* propagates border_width, if size doesn't change */
+ updatesizehints(c);
+ updatewmhints(c);
+@@ -1550,12 +1579,11 @@ setup(void) {
+ cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
+ cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
+ /* init appearance */
+- dc.norm[ColBorder] = getcolor(normbordercolor);
+- dc.norm[ColBG] = getcolor(normbgcolor);
+- dc.norm[ColFG] = getcolor(normfgcolor);
+- dc.sel[ColBorder] = getcolor(selbordercolor);
+- dc.sel[ColBG] = getcolor(selbgcolor);
+- dc.sel[ColFG] = getcolor(selfgcolor);
++ for(int i=0; i<NUMCOLORS; i++) {
++ dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder] );
++ dc.colors[i][ColFG] = getcolor( colors[i][ColFG] );
++ dc.colors[i][ColBG] = getcolor( colors[i][ColBG] );
++ }
+ dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
+ dc.gc = XCreateGC(dpy, root, 0, NULL);
+ XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
+@@ -1716,7 +1744,7 @@ unfocus(Client *c, Bool setfocus) {
+ if(!c)
+ return;
+ grabbuttons(c, False);
+- XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
++ XSetWindowBorder(dpy, c->win, dc.colors[0][ColBorder]);
+ if(setfocus)
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ }
View
244 02-dwm-6.0-pertag2.diff
@@ -0,0 +1,244 @@
+--- dwm.c.orig 2012-03-26 19:03:55.060707114 +0200
++++ dwm.c 2012-03-26 19:06:25.099846211 +0200
+@@ -126,8 +126,6 @@ typedef struct {
+
+ struct Monitor {
+ char ltsymbol[16];
+- float mfact;
+- int nmaster;
+ int num;
+ int by; /* bar geometry */
+ int mx, my, mw, mh; /* screen size */
+@@ -143,9 +141,21 @@ struct Monitor {
+ Monitor *next;
+ Window barwin;
+ const Layout *lt[2];
++ int curtag;
++ int prevtag;
++ const Layout **lts;
++ double *mfacts;
++ int *nmasters;
+ };
+
+ typedef struct {
++ const char *name;
++ const Layout *layout;
++ float mfact;
++ int nmaster;
++} Tag;
++
++typedef struct {
+ const char *class;
+ const char *instance;
+ const char *title;
+@@ -252,6 +262,7 @@ static int xerror(Display *dpy, XErrorEv
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
++static void bstack(Monitor *m);
+
+ /* variables */
+ static const char broken[] = "broken";
+@@ -442,7 +453,7 @@ buttonpress(XEvent *e) {
+ if(ev->window == selmon->barwin) {
+ i = x = 0;
+ do
+- x += TEXTW(tags[i]);
++ x += TEXTW(tags[i].name);
+ while(ev->x >= x && ++i < LENGTH(tags));
+ if(i < LENGTH(tags)) {
+ click = ClkTagBar;
+@@ -514,6 +525,9 @@ cleanupmon(Monitor *mon) {
+ }
+ XUnmapWindow(dpy, mon->barwin);
+ XDestroyWindow(dpy, mon->barwin);
++ free(mon->mfacts);
++ free(mon->nmasters);
++ free(mon->lts);
+ free(mon);
+ }
+
+@@ -647,17 +661,31 @@ configurerequest(XEvent *e) {
+ Monitor *
+ createmon(void) {
+ Monitor *m;
++ int i, numtags = LENGTH(tags) + 1;
+
+ if(!(m = (Monitor *)calloc(1, sizeof(Monitor))))
+ die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
++ if(!(m->mfacts = calloc(numtags, sizeof(double))))
++ die("fatal: could not malloc() %u bytes\n", sizeof(double) * numtags);
++ if(!(m->nmasters = calloc(numtags, sizeof(int))))
++ die("fatal: could not malloc() %u bytes\n", sizeof(int) * numtags);
++ if(!(m->lts = calloc(numtags, sizeof(Layout *))))
++ die("fatal: could not malloc() %u bytes\n", sizeof(Layout *) * numtags);
+ m->tagset[0] = m->tagset[1] = 1;
+- m->mfact = mfact;
+- m->nmaster = nmaster;
++ m->mfacts[0] = mfact;
++ m->nmasters[0] = nmaster;
++ m->lts[0] = &layouts[0];
+ m->showbar = showbar;
+ m->topbar = topbar;
+- m->lt[0] = &layouts[0];
++ m->curtag = m->prevtag = 1;
++ for(i = 1; i < numtags; i++) {
++ m->mfacts[i] = tags[i - 1].mfact < 0 ? mfact : tags[i - 1].mfact;
++ m->nmasters[i] = tags[i - 1].nmaster < 0 ? nmaster : tags[i - 1].nmaster;
++ m->lts[i] = tags[i - 1].layout;
++ }
++ m->lt[0] = m->lts[m->curtag];
+ m->lt[1] = &layouts[1 % LENGTH(layouts)];
+- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
++ strncpy(m->ltsymbol, m->lt[0]->symbol, sizeof m->ltsymbol);
+ return m;
+ }
+
+@@ -730,9 +758,9 @@ drawbar(Monitor *m) {
+ }
+ dc.x = 0;
+ for(i = 0; i < LENGTH(tags); i++) {
+- dc.w = TEXTW(tags[i]);
++ dc.w = TEXTW(tags[i].name);
+ col = dc.colors[ (m->tagset[m->seltags] & 1 << i ? 1:(urg & 1 << i ? 2:0))];
+- drawtext(tags[i], col, True);
++ drawtext(tags[i].name, col, True);
+ drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, col);
+ dc.x += dc.w;
+ }
+@@ -1057,7 +1085,7 @@ grabkeys(void) {
+
+ void
+ incnmaster(const Arg *arg) {
+- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
++ selmon->nmasters[selmon->curtag] = MAX(selmon->nmasters[selmon->curtag] + arg->i, 0);
+ arrange(selmon);
+ }
+
+@@ -1587,7 +1615,7 @@ setlayout(const Arg *arg) {
+ if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
+ selmon->sellt ^= 1;
+ if(arg && arg->v)
+- selmon->lt[selmon->sellt] = (Layout *)arg->v;
++ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v;
+ strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
+ if(selmon->sel)
+ arrange(selmon);
+@@ -1602,10 +1630,10 @@ setmfact(const Arg *arg) {
+
+ if(!arg || !selmon->lt[selmon->sellt]->arrange)
+ return;
+- f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
++ f = arg->f < 1.0 ? arg->f + selmon->mfacts[selmon->curtag] : arg->f - 1.0;
+ if(f < 0.1 || f > 0.9)
+ return;
+- selmon->mfact = f;
++ selmon->mfacts[selmon->curtag] = f;
+ arrange(selmon);
+ }
+
+@@ -1738,13 +1766,13 @@ tile(Monitor *m) {
+ if(n == 0)
+ return;
+
+- if(n > m->nmaster)
+- mw = m->nmaster ? m->ww * m->mfact : 0;
++ if(n > m->nmasters[m->curtag])
++ mw = m->nmasters[m->curtag] ? m->ww * m->mfacts[m->curtag] : 0;
+ else
+ mw = m->ww;
+ for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+- if(i < m->nmaster) {
+- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
++ if(i < m->nmasters[m->curtag]) {
++ h = (m->wh - my) / (MIN(n, m->nmasters[m->curtag]) - i);
+ resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
+ my += HEIGHT(c);
+ }
+@@ -1776,13 +1804,24 @@ togglefloating(const Arg *arg) {
+
+ void
+ toggletag(const Arg *arg) {
+- unsigned int newtags;
++ unsigned int i, newtags;
+
+ if(!selmon->sel)
+ return;
+ newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
+ if(newtags) {
+ selmon->sel->tags = newtags;
++ if(newtags == ~0) {
++ selmon->prevtag = selmon->curtag;
++ selmon->curtag = 0;
++ }
++ if(!(newtags & 1 << (selmon->curtag - 1))) {
++ selmon->prevtag = selmon->curtag;
++ for (i=0; !(newtags & 1 << i); i++);
++ selmon->curtag = i + 1;
++ }
++ selmon->sel->tags = newtags;
++ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
+ focus(NULL);
+ arrange(selmon);
+ }
+@@ -2071,11 +2110,26 @@ updatewmhints(Client *c) {
+
+ void
+ view(const Arg *arg) {
++ unsigned int i;
++
+ if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+- if(arg->ui & TAGMASK)
++ if(arg->ui & TAGMASK) {
+ selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
++ selmon->prevtag = selmon->curtag;
++ if(arg->ui == ~0)
++ selmon->curtag = 0;
++ else {
++ for (i=0; !(arg->ui & 1 << i); i++);
++ selmon->curtag = i + 1;
++ }
++ } else {
++ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
++ selmon->curtag^= selmon->prevtag;
++ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
++ }
++ selmon->lt[selmon->sellt]= selmon->lts[selmon->curtag];
+ focus(NULL);
+ arrange(selmon);
+ }
+@@ -2154,6 +2208,32 @@ zoom(const Arg *arg) {
+ pop(c);
+ }
+
++void
++bstack(Monitor *m) {
++ unsigned int i, n, w, mh, mx, tx;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if(n == 0)
++ return;
++
++ if(n > m->nmasters[m->curtag])
++ mh = m->nmasters[m->curtag] ? m->wh * m->mfacts[m->curtag] : 0;
++ else
++ mh = m->wh;
++ for(i = mx = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
++ if(i < m->nmasters[m->curtag]) {
++ w = (m->ww - mx) / (MIN(n, m->nmasters[m->curtag]) - i);
++ resize(c, m->wx + mx, m->wy, w - (2*c->bw), mh - (2*c->bw), False);
++ mx += WIDTH(c);
++ }
++ else {
++ w = (m->ww - tx) / (n - i);
++ resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - (2*c->bw), False);
++ tx += WIDTH(c);
++ }
++}
++
+ int
+ main(int argc, char *argv[]) {
+ if(argc == 2 && !strcmp("-v", argv[1]))
View
81 03-dwm-6.0-scratchpad-stay.diff
@@ -0,0 +1,81 @@
+--- dwm.c.orig 2011-12-19 18:19:17.275713017 +0100
++++ dwm.c 2011-12-19 18:20:58.811158588 +0100
+@@ -240,6 +240,7 @@ static int textnw(const char *text, unsi
+ static void tile(Monitor *);
+ static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
++static void togglescratch(const Arg *arg);
+ static void toggletag(const Arg *arg);
+ static void toggleview(const Arg *arg);
+ static void unfocus(Client *c, Bool setfocus);
+@@ -298,6 +299,8 @@ static Window root;
+ /* configuration, allows nested code to access above variables */
+ #include "config.h"
+
++static unsigned int scratchpadtag = 1 << LENGTH(tags); /* This tag specially for you, Scratchpad. */
++
+ /* compile-time check if all tags fit into an unsigned int bit array. */
+ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
+
+@@ -1170,6 +1173,16 @@ manage(Window w, XWindowAttributes *wa)
+ && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
+ c->bw = borderpx;
+
++ if(strcmp(c->name, scratchpadname) == 0) {
++ c->tags = scratchpadtag;
++ c->isfloating = True;
++ c->x = (c->mon->mw - c->w) - 10;
++ c->y = 20;
++ c->mon->tagset[c->mon->seltags] |= c->tags;
++ } else { /* make sure non-scratchpads stay out of scratchpadtag */
++ c->tags &= TAGMASK;
++ }
++
+ wc.border_width = c->bw;
+ XConfigureWindow(dpy, w, CWBorderWidth, &wc);
+ XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
+@@ -1775,6 +1788,25 @@ togglefloating(const Arg *arg) {
+ }
+
+ void
++togglescratch(const Arg *arg) {
++ Client *c = NULL;
++ unsigned int found = 0;
++ /* check if a scratchpad is already there in scratchpadtag */
++ for(c = selmon->clients; c && !(found = c->tags & scratchpadtag); c = c->next);
++ if(!found) { /* not found: launch it and put it in its tag (see manage()) */
++ spawn(arg);
++ return;
++ }
++ unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchpadtag;
++ if(newtagset) {
++ selmon->tagset[selmon->seltags] = newtagset;
++ arrange(selmon);
++ }
++ focus(c);
++}
++
++
++void
+ toggletag(const Arg *arg) {
+ unsigned int i, newtags;
+
+@@ -2083,8 +2115,9 @@ updatewmhints(Client *c) {
+ void
+ view(const Arg *arg) {
+ unsigned int i;
++ unsigned int stag = selmon->tagset[selmon->seltags] & scratchpadtag;
+
+- if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
++ if((arg->ui & TAGMASK) == (selmon->tagset[selmon->seltags] & TAGMASK))
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+ if(arg->ui & TAGMASK) {
+@@ -2101,6 +2134,7 @@ view(const Arg *arg) {
+ selmon->curtag^= selmon->prevtag;
+ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
+ }
++ selmon->tagset[selmon->seltags] |= stag;
+ selmon->lt[selmon->sellt]= selmon->lts[selmon->curtag];
+ focus(NULL);
+ arrange(selmon);
View
58 04-dwm-6.0-xbm_layout_icons.diff
@@ -0,0 +1,58 @@
+--- dwm.c.orig 2012-03-26 19:07:38.652228022 +0200
++++ dwm.c 2012-03-26 19:12:56.104395747 +0200
+@@ -120,6 +120,7 @@ typedef struct {
+ } Key;
+
+ typedef struct {
++ const char *icon;
+ const char *symbol;
+ void (*arrange)(Monitor *);
+ } Layout;
+@@ -188,6 +189,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);
+@@ -767,8 +769,16 @@ 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;
++ 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 +845,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 ]);
View
11 05-dwm-6.0-cflags.diff
@@ -0,0 +1,11 @@
+--- config.mk.orig 2011-07-10 22:24:25.000000000 +0200
++++ config.mk 2011-07-11 18:40:23.073559357 +0200
+@@ -21,7 +21,7 @@ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
+ # flags
+ CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+ #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
+-CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
++CFLAGS = -march=native -std=c99 -pedantic -Wall -O2 ${INCS} ${CPPFLAGS}
+ #LDFLAGS = -g ${LIBS}
+ LDFLAGS = -s ${LIBS}
+
View
24 06-dwm-6.0-monocle_no_borders.diff
@@ -1,11 +1,25 @@
---- a/dwm.c 2011-11-27 02:35:59.130398713 +0200
-+++ b/dwm.c 2011-11-27 02:35:59.132398714 +0200
-@@ -1247,7 +1247,7 @@ monocle(Monitor *m) {
- if(ISVISIBLE(c))
+--- 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++;
- for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ 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
View
399 09-dwm-6.0-systray.diff
@@ -0,0 +1,399 @@
+--- dwm.c.orig 2012-03-25 17:20:43.642609984 +0200
++++ dwm.c 2012-03-25 17:26:50.026547715 +0200
+@@ -55,12 +55,15 @@
+ #define TAGMASK ((1 << LENGTH(tags)) - 1)
+ #define TEXTW(X) (textnw(X, strlen(X)) + dc.font.height)
+
++#define SYSTEM_TRAY_REQUEST_DOCK 0
++#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
++
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
+ enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
+-enum { NetSupported, NetWMName, NetWMState,
+- NetWMFullscreen, NetActiveWindow, NetWMWindowType,
+- NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */
++enum { NetSupported, NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation,
++ NetWMName, NetWMState, NetWMFullscreen, NetActiveWindow,
++ NetWMWindowType, NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */
+ enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
+ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
+ ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
+@@ -168,6 +171,19 @@ typedef struct {
+ int monitor;
+ } Rule;
+
++typedef struct SystrayIcon SystrayIcon;
++struct SystrayIcon {
++ Window win;
++ XRectangle geo;
++ SystrayIcon *next;
++};
++
++typedef struct Systray Systray;
++struct Systray {
++ Window win;
++ SystrayIcon *icons;
++};
++
+ /* function declarations */
+ static void applyrules(Client *c);
+ static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact);
+@@ -204,6 +220,7 @@ static void focusstack(const Arg *arg);
+ static unsigned long getcolor(const char *colstr);
+ static Bool getrootptr(int *x, int *y);
+ static long getstate(Window w);
++unsigned int getsystraywidth();
+ static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
+ static void grabbuttons(Client *c, Bool focused);
+ static void grabkeys(void);
+@@ -222,7 +239,9 @@ static void pop(Client *);
+ static void propertynotify(XEvent *e);
+ static void quit(const Arg *arg);
+ static Monitor *recttomon(int x, int y, int w, int h);
++static void removesystrayicon(SystrayIcon *i);
+ static void resize(Client *c, int x, int y, int w, int h, Bool interact);
++static void resizebarwin(Monitor *m);
+ static void resizeclient(Client *c, int x, int y, int w, int h);
+ static void resizemouse(const Arg *arg);
+ static void restack(Monitor *m);
+@@ -257,12 +276,14 @@ static void updatebars(void);
+ static void updatenumlockmask(void);
+ static void updatesizehints(Client *c);
+ static void updatestatus(void);
++static void updatesystray();
+ static void updatewindowtype(Client *c);
+ static void updatetitle(Client *c);
+ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
++static SystrayIcon *wintosystrayicon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+@@ -270,6 +291,8 @@ static void zoom(const Arg *arg);
+ static void bstack(Monitor *m);
+
+ /* variables */
++static Systray *systray = NULL;
++static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
+ static const char broken[] = "broken";
+ static char stext[256];
+ static int screen;
+@@ -553,9 +576,37 @@ clearurgent(Client *c) {
+
+ void
+ clientmessage(XEvent *e) {
++ XWindowAttributes *wa;
+ XClientMessageEvent *cme = &e->xclient;
+ Client *c = wintoclient(cme->window);
++ SystrayIcon *i;
+
++ /* add systray icons */
++ if(cme->message_type == netatom[NetSystemTrayOP]) {
++ if(cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) {
++ if(!(i = (SystrayIcon *)calloc(1, sizeof(SystrayIcon))))
++ die("fatal: could not malloc() %u bytes\n", sizeof(SystrayIcon));
++ if(!(wa = (XWindowAttributes *)calloc(1, sizeof(XWindowAttributes))))
++ die("fatal: could not malloc() %u bytes\n", sizeof(XWindowAttributes));
++ i->win = cme->data.l[2];
++ i->next = systray->icons;
++ systray->icons = i;
++ /* deal with tray icons that have rectangle proportions */
++ XGetWindowAttributes(dpy, i->win, wa);
++ i->geo.height = bh;
++ if(wa->width == wa->height)
++ i->geo.width = bh;
++ else
++ i->geo.width = (int) (bh * (wa->width / wa->height));
++ XAddToSaveSet(dpy, i->win);
++ XSelectInput(dpy, i->win, StructureNotifyMask | ResizeRedirectMask
++ | PointerMotionMask | PointerMotionHintMask
++ | PropertyChangeMask| EnterWindowMask | FocusChangeMask);
++ XReparentWindow(dpy, i->win, systray->win, 0, 0);
++ XMapRaised(dpy, i->win);
++ updatesystray();
++ }
++ }
+ if(!c)
+ return;
+ if(cme->message_type == netatom[NetWMState]) {
+@@ -606,7 +657,7 @@ configurenotify(XEvent *e) {
+ dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
+ updatebars();
+ for(m = mons; m; m = m->next)
+- XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
++ resizebarwin(m);
+ focus(NULL);
+ arrange(NULL);
+ }
+@@ -700,10 +751,15 @@ createmon(void) {
+ void
+ destroynotify(XEvent *e) {
+ Client *c;
++ SystrayIcon *i;
+ XDestroyWindowEvent *ev = &e->xdestroywindow;
+
+ if((c = wintoclient(ev->window)))
+ unmanage(c, True);
++ else if((i = wintosystrayicon(ev->window))) {
++ removesystrayicon(i);
++ updatesystray();
++ }
+ }
+
+ void
+@@ -759,6 +815,7 @@ drawbar(Monitor *m) {
+ unsigned long *col;
+ Client *c;
+
++ resizebarwin(m);
+ for(c = m->clients; c; c = c->next) {
+ occ |= c->tags;
+ if(c->isurgent)
+@@ -788,6 +845,9 @@ drawbar(Monitor *m) {
+ if(m == selmon) { /* status is only drawn on selected monitor */
+ dc.w = TEXTW(stext);
+ dc.x = m->ww - dc.w;
++ if(showsystray && m == selmon) {
++ dc.x -= getsystraywidth();
++ }
+ if(dc.x < x) {
+ dc.x = x;
+ dc.w = m->ww - x;
+@@ -921,6 +981,7 @@ focus(Client *c) {
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ selmon->sel = c;
+ drawbars();
++ updatesystray();
+ }
+
+ void
+@@ -1021,6 +1082,14 @@ getstate(Window w) {
+ return result;
+ }
+
++unsigned int
++getsystraywidth() {
++ unsigned int w = 0;
++ SystrayIcon *i;
++ for(i = systray->icons; i; w += i->geo.width + systrayspacing, i = i->next) ;
++ return w;
++}
++
+ Bool
+ gettextprop(Window w, Atom atom, char *text, unsigned int size) {
+ char **list = NULL;
+@@ -1259,6 +1328,10 @@ void
+ maprequest(XEvent *e) {
+ static XWindowAttributes wa;
+ XMapRequestEvent *ev = &e->xmaprequest;
++ SystrayIcon *i;
++ if((i = wintosystrayicon(ev->window))) {
++ updatesystray();
++ }
+
+ if(!XGetWindowAttributes(dpy, ev->window, &wa))
+ return;
+@@ -1369,9 +1442,14 @@ pop(Client *c) {
+ void
+ propertynotify(XEvent *e) {
+ Client *c;
++ SystrayIcon *i;
+ Window trans;
+ XPropertyEvent *ev = &e->xproperty;
+
++ if((i = wintosystrayicon(ev->window))) {
++ /* TODO include XEMBED functionality from systray_state */
++ updatesystray();
++ }
+ if((ev->window == root) && (ev->atom == XA_WM_NAME))
+ updatestatus();
+ else if(ev->state == PropertyDelete)
+@@ -1421,12 +1499,32 @@ recttomon(int x, int y, int w, int h) {
+ }
+
+ void
++removesystrayicon(SystrayIcon *i) {
++ SystrayIcon **ii;
++
++ if(!i || !showsystray)
++ return;
++ for(ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
++ *ii = i->next;
++ free(i);
++}
++
++
++void
+ resize(Client *c, int x, int y, int w, int h, Bool interact) {
+ if(applysizehints(c, &x, &y, &w, &h, interact))
+ resizeclient(c, x, y, w, h);
+ }
+
+ void
++resizebarwin(Monitor *m) {
++ unsigned int w = m->ww;
++ if(showsystray && m == selmon)
++ w -= getsystraywidth();
++ XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh);
++}
++
++void
+ resizeclient(Client *c, int x, int y, int w, int h) {
+ XWindowChanges wc;
+
+@@ -1681,6 +1779,9 @@ setup(void) {
+ wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False);
+ netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
+ netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
++ netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False);
++ netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
++ netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False);
+ netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
+ netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
+ netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
+@@ -1705,6 +1806,8 @@ setup(void) {
+ XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
+ if(!dc.font.set)
+ XSetFont(dpy, dc.gc, dc.font.xfont->fid);
++ /* init system tray */
++ updatesystray();
+ /* init bars */
+ updatebars();
+ updatestatus();
+@@ -1813,8 +1916,18 @@ void
+ togglebar(const Arg *arg) {
+ selmon->showbar = !selmon->showbar;
+ updatebarpos(selmon);
+- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
+ arrange(selmon);
++ if(showsystray) {
++ XWindowChanges wc;
++ if(!selmon->showbar)
++ wc.y = -bh;
++ else if(selmon->showbar) {
++ wc.y = 0;
++ if(!selmon->topbar)
++ wc.y = selmon->mh - bh;
++ }
++ XConfigureWindow(dpy, systray->win, CWY, &wc);
++ }
+ }
+
+ void
+@@ -1928,6 +2041,7 @@ unmanage(Client *c, Bool destroyed) {
+ void
+ unmapnotify(XEvent *e) {
+ Client *c;
++ SystrayIcon *i;
+ XUnmapEvent *ev = &e->xunmap;
+
+ if((c = wintoclient(ev->window))) {
+@@ -1935,19 +2049,27 @@ unmapnotify(XEvent *e) {
+ setclientstate(c, WithdrawnState);
+ else
+ unmanage(c, False);
++ } else if((i = wintosystrayicon(ev->window))) {
++ removesystrayicon(i);
++ updatesystray();
+ }
+ }
+
+ void
+ updatebars(void) {
++ unsigned int w;
+ Monitor *m;
++
+ XSetWindowAttributes wa = {
+ .override_redirect = True,
+ .background_pixmap = ParentRelative,
+ .event_mask = ButtonPressMask|ExposureMask
+ };
+ for(m = mons; m; m = m->next) {
+- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
++ w = m->ww;
++ if(showsystray && m == selmon)
++ w -= getsystraywidth();
++ m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen),
+ CopyFromParent, DefaultVisual(dpy, screen),
+ CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
+ XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
+@@ -2131,6 +2253,59 @@ updatestatus(void) {
+ }
+
+ void
++updatesystray(void) {
++ XSetWindowAttributes wa;
++ XEvent event;
++ SystrayIcon *i;
++ unsigned int x = selmon->mx + selmon->mw;
++ unsigned int w = 1;
++
++ if(!showsystray)
++ return;
++ if(!systray) {
++ /* init systray */
++ if(!(systray = (Systray *)calloc(1, sizeof(Systray))))
++ die("fatal: could not malloc() %u bytes\n", sizeof(Systray));
++ systray->win = XCreateSimpleWindow(dpy, root, x, selmon->by, w, bh, 0, 0, dc.colors[0][ColBG]);
++ wa.event_mask = ButtonPressMask | ExposureMask;
++ wa.override_redirect = True;
++ wa.background_pixmap = ParentRelative;
++ wa.background_pixel = dc.colors[0][ColBG];
++ XSelectInput(dpy, systray->win, SubstructureNotifyMask | SubstructureRedirectMask
++ | PointerMotionMask | PointerMotionHintMask | KeyPressMask | ButtonPressMask);
++ XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
++ PropModeReplace, (unsigned char *)&systrayorientation, 1);
++ XChangeWindowAttributes(dpy, systray->win, CWEventMask | CWOverrideRedirect | CWBackPixel, &wa);
++ memset(&wa, 0, sizeof(XWindowAttributes));
++ XMapRaised(dpy, systray->win);
++ XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime);
++ if(XGetSelectionOwner(dpy, netatom[NetSystemTray]) != systray->win)
++ fprintf(stderr, "dwm: unable to obtain system tray.\n");
++ else {
++ memset(&event, 0, sizeof(event));
++ event.xclient.type = ClientMessage;
++ event.xclient.window = root;
++ event.xclient.message_type = XInternAtom(dpy, "MANAGER", False);
++ event.xclient.format = 32;
++ event.xclient.data.l[0] = CurrentTime;
++ event.xclient.data.l[1] = netatom[NetSystemTray];
++ event.xclient.data.l[2] = systray->win;
++ event.xclient.data.l[3] = 0;
++ event.xclient.data.l[4] = 0;
++ XSendEvent(dpy, root, False, StructureNotifyMask, &event);
++ XSync(dpy, False);
++ }
++ }
++ for(i = systray->icons; i; i = i->next) {
++ XMapWindow(dpy, i->win);
++ XMoveResizeWindow(dpy, i->win, (i->geo.x = w), 0, i->geo.width, i->geo.height);
++ w += i->geo.width + systrayspacing;
++ }
++ x -= w;
++ XMoveResizeWindow(dpy, systray->win, x, selmon->by, w, bh);
++}
++
++void
+ updatewindowtype(Client *c) {
+ Atom state = getatomprop(c, netatom[NetWMState]);
+ Atom wtype = getatomprop(c, netatom[NetWMWindowType]);
+@@ -2220,6 +2395,16 @@ wintomon(Window w) {
+ return selmon;
+ }
+
++SystrayIcon *
++wintosystrayicon(Window w) {
++ SystrayIcon *i = NULL;
++
++ if(!w)
++ return i;
++ for(i = systray->icons; i && i->win != w; i = i->next) ;
++ return i;
++}
++
+ /* There's no way to check accesses to destroyed windows, thus those cases are
+ * ignored (especially on UnmapNotify's). Other types of errors call Xlibs
+ * default error handler, which may call exit. */
View
14 PKGBUILD
@@ -21,14 +21,15 @@ source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
im-grid.c
togglefullscreen.c
push.c)
-_patches=(01-dwm-$pkgver-pertag2.diff
- 02-dwm-$pkgver-scratchpad-stay.diff
- 03-dwm-$pkgver-xbm_layout_icons.diff
- 04-dwm-$pkgver-cflags.diff
- 05-dwm-$pkgver-urgentcolor.diff
+_patches=(01-dwm-$pkgver-statuscolors.diff
+ 02-dwm-$pkgver-pertag2.diff
+ 03-dwm-$pkgver-scratchpad-stay.diff
+ 04-dwm-$pkgver-xbm_layout_icons.diff
+ 05-dwm-$pkgver-cflags.diff
06-dwm-$pkgver-monocle_no_borders.diff
07-dwm-$pkgver-centred-floating.diff
- 08-dwm-$pkgver-save_floats.diff)
+ 08-dwm-$pkgver-save_floats.diff
+ 09-dwm-$pkgver-systray.diff)
source=(${source[@]} ${_patches[@]})
@@ -37,6 +38,7 @@ build() {
# patch time!
for p in "${_patches[@]}"; do
+ echo "--- $p ---"
patch < ../$p || return 1
done
View
40 config.h
@@ -7,22 +7,22 @@
/* appearance */
static const char font[] = "-*-termsyn.icons-medium-*-*-*-11-*-*-*-*-*-*-*";
-static const char normbordercolor[] = "#1A1A1A";
-static const char normbgcolor[] = "#020202";
-static const char normfgcolor[] = "#808080";
-static const char selbordercolor[] = "#4C4C4C";
-static const char selbgcolor[] = "#020202";
-static const char selfgcolor[] = "#B3B3B3";
-static const char urgbordercolor[] = "#802635";
-static const char urgfgcolor[] = "#020202";
-static const char urgbgcolor[] = "#B3354C";
+#define NUMCOLORS 3
+static const char colors[NUMCOLORS][ColLast][8] = {
+ // border foreground background
+ { "#1A1A1A", "#808080", "#020202" }, // normal
+ { "#4C4C4C", "#B3B3B3", "#020202" }, // selected
+ { "#B3354C", "#B3354C", "#020202" }, // urgent
+};
-static const unsigned int borderpx = 1; // border pixel of windows
-static const unsigned int snap = 5; // snap pixel
-static const Bool showbar = True; // False means no bar
-static const Bool topbar = True; // False means bottom bar
-static Bool useicons = True; // False means use ascii symbols
-static const char scratchpadname[] = "Scratchpad";
+static const unsigned int borderpx = 1; // border pixel of windows
+static const unsigned int snap = 5; // snap pixel
+static const unsigned int systrayspacing = 1; // space between systray icons
+static const Bool showsystray = True; // False means no systray
+static const Bool showbar = True; // False means no bar
+static const Bool topbar = True; // False means bottom bar
+static Bool useicons = True; // False means use ascii symbols
+static const char scratchpadname[] = "Scratchpad";
/* layout(s) */
static const float mfact = 0.50; // factor of master area size [0.05..0.95]
@@ -90,9 +90,12 @@ static const Rule rules[] = {
/* commands */
static const char *addresscmd[] = { "urxvtc", "-title", "abook", "-e", "/home/ok/bin/abook-autoexport", NULL };
static const char *browsercmd[] = { "/home/ok/bin/browser", NULL };
+static const char *calendarcmd[] = { "gsimplecal", NULL };
+static const char *cpucmd[] = { "/home/ok/bin/cpu_control.sh", NULL };
static const char *dictcmd[] = { "stardict", NULL };
-static const char *dmenucmd[] = { "dmenu_run", "-i", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor,
- "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+static const char *dmenucmd[] = { "dmenu_run", "-i", "-fn", font, "-nb", colors[0][ColBG], "-nf", colors[0][ColFG],
+ "-sb", colors[1][ColBG], "-sf", colors[1][ColFG], NULL };
+static const char *fancmd[] = { "/home/ok/bin/fan_control.sh", NULL };
static const char *imcmd[] = { "pidgin", NULL };
static const char *irccmd[] = {"urxvtc", "-title", "Weechat", "-e", "weechat-curses", NULL };
static const char *logoutcmd[] = { "sudo", "killall", "X", NULL };
@@ -181,5 +184,8 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
{ ClkRootWin, 0, Button3, spawn, {.v = menucmd } },
+ { ClkStatusText, 0, Button1, spawn, {.v = calendarcmd } },
+ { ClkStatusText, 0, Button3, spawn, {.v = cpucmd } },
+ { ClkStatusText, MODKEY, Button3, spawn, {.v = fancmd } },
};
Please sign in to comment.
Something went wrong with that request. Please try again.