about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.def.h8
-rw-r--r--dwm.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/config.def.h b/config.def.h
index 8130909..76e7ed3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -28,8 +28,8 @@ DEFGEOM(dual,    0,  0,1280, 0, bh, ww, wh-bh, wx, wy, 1280,800-bh,  1280,  0, w
 
 Geom geoms[] = {
 	/* symbol	function */
-	{ "[]",		single },	/* first entry is default */
-	{ "[][]",	dual },
+	{ "<>",		single },	/* first entry is default */
+	{ ")(",		dual },
 };
 
 /* layout(s) */
@@ -48,8 +48,8 @@ Layout layouts[] = {
 #define MODKEY			Mod1Mask
 Key keys[] = {
 	/* modifier			key		function	argument */
-	{ MODKEY,			XK_a,		setgeom,	"[][]" },
-	{ MODKEY,			XK_d,		setgeom,	"[]" },
+	{ MODKEY,			XK_a,		setgeom,	")(" },
+	{ MODKEY,			XK_d,		setgeom,	"<>" },
 	{ MODKEY,			XK_p,		spawn,
 		"exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
 	{ MODKEY|ShiftMask,		XK_Return,	spawn, "exec uxterm" },
diff --git a/dwm.c b/dwm.c
index f83e800..6b46911 100644
--- a/dwm.c
+++ b/dwm.c
@@ -210,7 +210,7 @@ void zoom(const char *arg);
 char stext[256], buf[256];
 int screen, sx, sy, sw, sh;
 int (*xerrorxlib)(Display *, XErrorEvent *);
-int bx, by, bw, bh, blw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh;
+int bx, by, bw, bh, blw, bgw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh;
 unsigned int numlockmask = 0;
 void (*handler[LASTEvent]) (XEvent *) = {
 	[ButtonPress] = buttonpress,
@@ -322,10 +322,10 @@ buttonpress(XEvent *e) {
 	XButtonPressedEvent *ev = &e->xbutton;
 
 	if(ev->window == barwin) {
-		x = 0;
+		x = bgw;
 		for(i = 0; i < LENGTH(tags); i++) {
 			x += textw(tags[i]);
-			if(ev->x < x) {
+			if(ev->x > bgw && ev->x < x) {
 				if(ev->button == Button1) {
 					if(ev->state & MODKEY)
 						tag(tags[i]);
@@ -514,6 +514,9 @@ drawbar(void) {
 	Client *c;
 
 	dc.x = 0;
+	dc.w = bgw;
+	drawtext(geom->symbol, dc.norm, False);
+	dc.x += bgw;
 	for(c = stack; c && !isvisible(c); c = c->snext);
 	for(i = 0; i < LENGTH(tags); i++) {
 		dc.w = textw(tags[i]);
@@ -854,7 +857,7 @@ unsigned int
 idxoftag(const char *t) {
 	unsigned int i;
 
-	for(i = 0; (i < LENGTH(tags)) && (tags[i] != t); i++);
+	for(i = 0; (i < LENGTH(tags)) && strcmp(tags[i], t); i++);
 	return (i < LENGTH(tags)) ? i : 0;
 }
 
@@ -1501,6 +1504,11 @@ setup(void) {
 		if(i > blw)
 			blw = i;
 	}
+	for(bgw = i = 0; i < LENGTH(geoms); i++) {
+		i = textw(geoms[i].symbol);
+		if(i > bgw)
+			bgw = i;
+	}
 
 	wa.override_redirect = 1;
 	wa.background_pixmap = ParentRelative;
-01 23:30:47 -0800 5862' href='/akkartik/mu/commit/SubX-addressing-modes.md?h=main&id=01013f2ad2132dd945c6ceb168b85dc52e18882c'>01013f2a ^
e2e0f5cc ^
01013f2a ^



e2e0f5cc ^
01013f2a ^





































9e5e87ca ^

01013f2a ^













9a524793 ^






7817fdb2 ^






















9a524793 ^


7817fdb2 ^





9a524793 ^







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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172