some changes towards 4.9 e237b2a7
Anselm R Garbe · 2008-03-14 14:35 4 file(s) · +38 −31
config.anselm.h +20 −17
14 14
const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
15 15
16 16
Rule rules[] = {
17 -
	/* class:instance:title substr	tags ref	isfloating */
18 -
	{ "Firefox",			tags[8],	False },
19 -
	{ "Gimp",			NULL,		True },
20 -
	{ "MPlayer",			NULL,		True },
21 -
	{ "Acroread",			NULL,		True },
17 +
	/* class	instance	title		tags ref	isfloating */
18 +
	{ NULL,		NULL,		"Firefox",	tags[8],	False },
19 +
	{ NULL,		NULL,		"Gimp",		NULL,		True },
20 +
	{ NULL,		NULL,		"MPlayer",	NULL,		True },
21 +
	{ NULL,		NULL,		"Acroread",	NULL,		True },
22 22
};
23 23
24 -
/* layout(s) */
25 -
#define RESIZEHINTS		True	/* False - respect size hints in tiled resizals */
26 -
#define SNAP			32	/* snap pixel */
27 -
28 -
Layout layouts[] = {
29 -
	/* symbol		function	isfloating */
30 -
	{ "[]|",		tileh,		False }, /* first entry is default */
31 -
	{ "[]=",		tilev,		False },
32 -
	{ "><>",		floating,	True },
33 -
	{ "[M]",		monocle,	True },
34 -
};
24 +
/* geometry function */
25 +
void (*setgeoms)(void) = setdefgeoms;
35 26
36 27
void
37 28
setanselmgeoms(void) {
83 74
84 75
void
85 76
defgeoms(const char *arg) {
86 -
	setgeoms = setdefaultgeoms;
77 +
	setgeoms = setdefgeoms;
87 78
	setgeoms();
88 79
	updatebarpos();
89 80
	setlayout("[]=");
90 81
}
82 +
83 +
/* layout(s) */
84 +
#define RESIZEHINTS		True	/* False - respect size hints in tiled resizals */
85 +
#define SNAP			32	/* snap pixel */
86 +
87 +
Layout layouts[] = {
88 +
	/* symbol		function	isfloating */
89 +
	{ "[]|",		tileh,		False }, /* first entry is default */
90 +
	{ "[]=",		tilev,		False },
91 +
	{ "><>",		floating,	True },
92 +
	{ "[M]",		monocle,	True },
93 +
};
91 94
92 95
/* key definitions */
93 96
#define MODKEY			Mod1Mask
config.def.h +8 −5
14 14
const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
15 15
16 16
Rule rules[] = {
17 -
	/* class:instance:title substr	tags ref	isfloating */
18 -
	{ "Firefox",			tags[8],	False },
19 -
	{ "Gimp",			NULL,		True },
20 -
	{ "MPlayer",			NULL,		True },
21 -
	{ "Acroread",			NULL,		True },
17 +
	/* class	instance	title		tags ref	isfloating */
18 +
	{ NULL,		NULL,		"Firefox",	tags[8],	False },
19 +
	{ NULL,		NULL,		"Gimp",		NULL,		True },
20 +
	{ NULL,		NULL,		"MPlayer",	NULL,		True },
21 +
	{ NULL,		NULL,		"Acroread",	NULL,		True },
22 22
};
23 +
24 +
/* geometry function */
25 +
void (*setgeoms)(void) = setdefgeoms;
23 26
24 27
/* layout(s) */
25 28
#define RESIZEHINTS		True	/* False - respect size hints in tiled resizals */
config.mk +1 −1
1 1
# dwm version
2 -
VERSION = 4.8
2 +
VERSION = 4.9
3 3
4 4
# Customize below to fit your system
5 5
dwm.c +9 −8
99 99
} Layout; 
100 100
101 101
typedef struct {
102 -
	const char *prop;
102 +
	const char *class;
103 +
	const char *instance;
104 +
	const char *title;
103 105
	const char *tag;
104 106
	Bool isfloating;
105 107
} Rule;
161 163
void run(void);
162 164
void scan(void);
163 165
void setclientstate(Client *c, long state);
164 -
void setdefaultgeoms(void);
166 +
void setdefgeoms(void);
165 167
void setlayout(const char *arg);
166 168
void setup(void);
167 169
void spawn(const char *arg);
224 226
DC dc = {0};
225 227
Layout *lt = NULL;
226 228
Window root, barwin;
227 -
void (*setgeoms)(void) = setdefaultgeoms;
228 229
229 230
/* configuration, allows nested code to access above variables */
230 231
#include "config.h"
244 245
	XGetClassHint(dpy, c->win, &ch);
245 246
	for(i = 0; i < LENGTH(rules); i++) {
246 247
		r = &rules[i];
247 -
		if(strstr(c->name, r->prop)
248 -
		|| (ch.res_class && strstr(ch.res_class, r->prop))
249 -
		|| (ch.res_name && strstr(ch.res_name, r->prop)))
248 +
		if(strstr(c->name, r->title)
249 +
		|| (ch.res_class && r->class && strstr(ch.res_class, r->class))
250 +
		|| (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
250 251
		{
251 252
			c->isfloating = r->isfloating;
252 253
			if(r->tag) {
1051 1052
}
1052 1053
1053 1054
void
1054 -
monocle(void) { 
1055 +
monocle(void) {
1055 1056
	Client *c;
1056 1057
1057 1058
	for(c = clients; c; c = c->next)
1390 1391
}
1391 1392
1392 1393
void
1393 -
setdefaultgeoms(void) {
1394 +
setdefgeoms(void) {
1394 1395
1395 1396
	/* screen dimensions */
1396 1397
	sx = 0;