This repository has been archived by the owner on Jan 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdwm-6.0-occupiedcolor.diff
66 lines (65 loc) · 2.23 KB
/
dwm-6.0-occupiedcolor.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- dwm.c.orig 2013-03-27 16:55:46.673284053 +0100
+++ dwm.c 2013-03-27 16:58:06.816615028 +0100
@@ -101,6 +101,7 @@
int x, y, w, h;
unsigned long norm[ColLast];
unsigned long sel[ColLast];
+ unsigned long occ[ColLast];
Drawable drawable;
GC gc;
struct {
@@ -178,7 +179,6 @@
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 enternotify(XEvent *e);
static void expose(XEvent *e);
@@ -730,10 +730,8 @@
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;
+ col = (m->tagset[m->seltags] & 1 << i) ? dc.sel : (urg & 1 << i ? dc.urg : 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);
dc.x += dc.w;
}
dc.w = blw = TEXTW(m->ltsymbol);
@@ -756,7 +754,6 @@
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);
}
else
drawtext(NULL, dc.norm, False);
@@ -774,18 +771,6 @@
}
void
-drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
- int x;
-
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : 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);
- else if(empty)
- XDrawRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x, x);
-}
-
-void
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
char buf[256];
int i, x, y, h, len, olen;
@@ -1618,6 +1603,8 @@
dc.sel[ColBorder] = getcolor(selbordercolor);
dc.sel[ColBG] = getcolor(selbgcolor);
dc.sel[ColFG] = getcolor(selfgcolor);
+ dc.occ[ColBG] = getcolor(occbgcolor);
+ dc.occ[ColFG] = getcolor(occfgcolor);
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);