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);
artik.com> 2015-05-05 17:17:43 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-05-05 17:17:43 -0700 1264' href='/akkartik/mu/commit/cpp/030container.cc?h=main&id=ca12558ef7f0678cd7b4aee9e8dda459e61f1bc1'>ca12558e ^
f608504a ^
db5c9550 ^
f608504a ^







88be3dbc ^
f608504a ^







7e9c6925 ^

db5c9550 ^
69f3fb0a ^
f608504a ^
a66c9ae6 ^
f608504a ^




7284d503 ^
88be3dbc ^
f608504a ^













1848b18f ^

916ae8f5 ^

916ae8f5 ^

dcfca05e ^

f1a3be1c ^

db5c9550 ^
dcfca05e ^

a66c9ae6 ^
6cc46216 ^
a66c9ae6 ^
3076bab4 ^
6cc46216 ^
916ae8f5 ^
db5c9550 ^
916ae8f5 ^


e853b94e ^
7da71d03 ^
e853b94e ^
916ae8f5 ^

dcfca05e ^
916ae8f5 ^


f608504a ^
dd994cda ^
3c435756 ^
f608504a ^

88be3dbc ^
6cc46216 ^





6f5d7864 ^
6cc46216 ^





57699011 ^
6cc46216 ^
7284d503 ^
1848b18f ^
88be3dbc ^
1848b18f ^












a4559f72 ^

a4559f72 ^

dcfca05e ^

f1a3be1c ^

db5c9550 ^
dcfca05e ^

a66c9ae6 ^
79f4349c ^
a66c9ae6 ^
3076bab4 ^
79f4349c ^
a4559f72 ^



dcfca05e ^
a4559f72 ^

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