about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.def.h39
-rw-r--r--dwm.c18
2 files changed, 29 insertions, 28 deletions
diff --git a/config.def.h b/config.def.h
index 1b2349c..49d2f1f 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,20 +1,20 @@
 /* See LICENSE file for copyright and license details. */
 
 /* appearance */
-#define FONT            "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*"
-#define NORMBORDERCOLOR "#cccccc"
-#define NORMBGCOLOR     "#cccccc"
-#define NORMFGCOLOR     "#000000"
-#define SELBORDERCOLOR  "#0066ff"
-#define SELBGCOLOR      "#0066ff"
-#define SELFGCOLOR      "#ffffff"
-static uint borderpx    = 1;        /* border pixel of windows */
-static uint snap        = 32;       /* snap pixel */
-static Bool showbar     = True;     /* False means no bar */
-static Bool topbar      = True;     /* False means bottom bar */
+static const char font[]            = "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*";
+static const char normbordercolor[] = "#cccccc";
+static const char normbgcolor[]     = "#cccccc";
+static const char normfgcolor[]     = "#000000";
+static const char selbordercolor[]  = "#0066ff";
+static const char selbgcolor[]      = "#0066ff";
+static const char selfgcolor[]      = "#ffffff";
+static uint borderpx                = 1;        /* border pixel of windows */
+static uint snap                    = 32;       /* snap pixel */
+static Bool showbar                 = True;     /* False means no bar */
+static Bool topbar                  = True;     /* False means bottom bar */
 
 #ifdef XINERAMA
-static uint xidx        = 0;        /* Xinerama screen index to use */
+static uint xidx                    = 0;        /* Xinerama screen index to use */
 #endif
 
 /* tagging */
@@ -45,12 +45,16 @@ static Layout layouts[] = {
 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
 
 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
-#define SHCMD(cmd) { .v = (char*[]){ "/bin/sh", "-c", cmd, NULL } }
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
+/* commands */
+static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+static const char *termcmd[]  = { "uxterm", NULL };
 
 static Key keys[] = {
 	/* modifier                     key        function        argument */
-	{ MODKEY,                       XK_p,      spawn,          {.v = (char *[]){"dmenu_run", "-fn", FONT, "-nb", NORMBGCOLOR, "-nf", NORMFGCOLOR, "-sb", SELBGCOLOR, "-sf", SELFGCOLOR, NULL}} },
-	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = (char *[]){"uxterm", NULL}} },
+	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
+	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
 	{ MODKEY,                       XK_b,      togglebar,      {0} },
 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
@@ -89,15 +93,14 @@ static Button buttons[] = {
 	/* click                event mask      button          function        argument */
 	{ ClkLtSymbol,          0,              Button1,        togglelayout,   {0} },
 	{ ClkLtSymbol,          0,              Button3,        togglemax,      {0} },
-	{ ClkWinTitle,          0,              Button1,        movemouse,      {0} },
 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
-	{ ClkWinTitle,          0,              Button3,        resizemouse,    {0} },
+	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
 	{ ClkWinTitle,          0,              Button4,        focusstack,     {.i = +1 } },
 	{ ClkWinTitle,          0,              Button5,        focusstack,     {.i = -1 } },
 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
-	{ ClkRootWin,           Button1Mask,    Button3,        spawn,          {.v = (char *[]){"uxterm", NULL}} },
+	{ ClkRootWin,           Button1Mask,    Button3,        spawn,          {.v = termcmd } },
 	TAGBUTTONS(0)
 	TAGBUTTONS(1)
 	TAGBUTTONS(2)
diff --git a/dwm.c b/dwm.c
index d13a7a2..05c0199 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1321,12 +1321,12 @@ setup(void) {
 	/* init screen */
 	screen = DefaultScreen(dpy);
 	root = RootWindow(dpy, screen);
-	initfont(FONT);
+	initfont(font);
 	sx = 0;
 	sy = 0;
 	sw = DisplayWidth(dpy, screen);
 	sh = DisplayHeight(dpy, screen);
-	bh = dc.font.height + 2;
+	bh = dc.h = dc.font.height + 2;
 	lt = layouts;
 	updategeom();
 
@@ -1344,14 +1344,12 @@ setup(void) {
 	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);
-	initfont(FONT);
-	dc.h = bh;
+	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);
 	dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
 	dc.gc = XCreateGC(dpy, root, 0, 0);
 	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
<sir@cmpwn.com> 2019-01-13 13:33:43 -0500 committer Drew DeVault <sir@cmpwn.com> 2019-01-13 13:33:43 -0500 Move ex line into account' href='/akspecs/aerc/commit/widgets/account.go?h=0.2.0&id=c286d3da6ba8636412db5c3b72fda739a06e7f6c'>c286d3d ^
589db74 ^



c286d3d ^
b76deea ^
0911cd5 ^
99c363b ^
150a271 ^
2279ac3 ^

2349b7d ^
fcdcd32 ^
0f8b7a1 ^

24dfc47 ^
589db74 ^








0911cd5 ^


0911cd5 ^
24dfc47 ^

589db74 ^
0911cd5 ^
24dfc47 ^
0911cd5 ^

a15ea01 ^
2dc4365 ^


a15ea01 ^









17bd2dc ^



475b697 ^







62946ff ^
24dfc47 ^
62946ff ^

607ece8 ^
1228448 ^


648ca98 ^
b76deea ^


648ca98 ^








c286d3d ^
589db74 ^

c286d3d ^
2349b7d ^

5de1bb8 ^
2349b7d ^
589db74 ^
cf66462 ^



77c76ba ^
cf66462 ^



626f91c ^
cf66462 ^

99c363b ^


cf66462 ^
589db74 ^
cf66462 ^
2349b7d ^

b60999c ^




24daef8 ^



753adb9 ^



363aab5 ^



217e85a ^




753adb9 ^

363aab5 ^

753adb9 ^

b60999c ^
b389647 ^



4ec7f5d ^








acfe7d7 ^

b389647 ^

cce7cb4 ^
b389647 ^

cce7cb4 ^

026e8a1 ^



b389647 ^

5090a4c ^


0abafa6 ^
5090a4c ^


b389647 ^
5090a4c ^


312a53e ^
5090a4c ^


b389647 ^

589db74 ^
2958579 ^
b389647 ^
b60999c ^
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234