monocle goes mainstream 96ee9d88
Anselm R Garbe · 2008-03-04 18:58 2 file(s) · +15 −2
config.def.h +3 −1
12 12
#define SELFGCOLOR		"#ffffff"
13 13
14 14
/* old */
15 -
const char tags[][MAXTAGLEN]     = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
15 +
const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
16 16
17 17
Rule rules[] = {
18 18
	/* class:instance:title substr	tags ref	isfloating */
30 30
	/* symbol		function */
31 31
	{ "[]=",		tile }, /* first entry is default */
32 32
	{ "><>",		floating },
33 +
	{ "[M]",		monocle },
33 34
};
34 35
35 36
/* key definitions */
46 47
	{ MODKEY,			XK_h,		setmwfact,	"-0.05" },
47 48
	{ MODKEY,			XK_l,		setmwfact,	"+0.05" },
48 49
	{ MODKEY,			XK_r,		reapply,	NULL },
50 +
	{ MODKEY,			XK_m,		setlayout,	"[M]" },
49 51
	{ MODKEY,			XK_Return,	zoom,		NULL },
50 52
	{ MODKEY,			XK_Tab,		viewprevtag,	NULL },
51 53
	{ MODKEY|ShiftMask,		XK_space,	togglefloating,	NULL },
dwm.c +12 −1
153 153
void manage(Window w, XWindowAttributes *wa);
154 154
void mappingnotify(XEvent *e);
155 155
void maprequest(XEvent *e);
156 +
void monocle(void);
156 157
void movemouse(Client *c);
157 158
Client *nexttiled(Client *c);
158 159
void propertynotify(XEvent *e);
1072 1073
}
1073 1074
1074 1075
void
1076 +
monocle(void) {
1077 +
	Client *c;
1078 +
1079 +
	domwfact = dozoom = False;
1080 +
	for(c = clients; c; c = c->next)
1081 +
		if(isvisible(c))
1082 +
			resize(c, wax, way, waw - 2 * c->border, wah - 2 * c->border, RESIZEHINTS);
1083 +
}
1084 +
1085 +
void
1075 1086
movemouse(Client *c) {
1076 1087
	int x1, y1, ocx, ocy, di, nx, ny;
1077 1088
	unsigned int dui;
1412 1423
	}
1413 1424
	else {
1414 1425
		for(i = 0; i < LENGTH(layouts); i++)
1415 -
			if(arg == layouts[i].symbol)
1426 +
			if(!strcmp(arg, layouts[i].symbol))
1416 1427
				break;
1417 1428
		if(i == LENGTH(layouts))
1418 1429
			return;