forked from drduh/config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dwm.patch
144 lines (132 loc) · 5.48 KB
/
dwm.patch
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
# https://github.com/drduh/config/blob/master/dwm.patch
# Run 'make' before applying with 'patch < dwm.patch' then run 'make' again
--- a/config.h Sun Jan 01 00:00:00 2019
+++ b/config.h Sun Jan 01 00:00:01 2019
@@ -1,17 +1,41 @@
/* See LICENSE file for copyright and license details. */
+void grid(Monitor *m) {
+ unsigned int i, n, cx, cy, cw, ch, aw, ah, cols, rows;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ n++;
+
+ for(rows = 0; rows <= n/2; rows++)
+ if(rows*rows >= n)
+ break;
+ cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;
+
+ ch = m->wh / (rows ? rows : 1);
+ cw = m->ww / (cols ? cols : 1);
+ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+ cx = m->wx + (i / rows) * cw;
+ cy = m->wy + (i % rows) * ch;
+ ah = ((i + 1) % rows == 0) ? m->wh - ch * rows : 0;
+ aw = (i >= rows * (cols - 1)) ? m->ww - cw * cols : 0;
+ resize(c, cx, cy, cw - 2 * c->bw + aw, ch - 2 * c->bw + ah, False);
+ i++;
+ }
+}
+
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
-static const char *fonts[] = { "monospace:size=10" };
-static const char dmenufont[] = "monospace:size=10";
-static const char col_gray1[] = "#222222";
-static const char col_gray2[] = "#444444";
-static const char col_gray3[] = "#bbbbbb";
-static const char col_gray4[] = "#eeeeee";
-static const char col_cyan[] = "#005577";
+static const char *fonts[] = { "Inconsolata:size=18" };
+static const char dmenufont[] = "Inconsolata:size=18";
+static const char col_gray1[] = "#002b36";
+static const char col_gray2[] = "#002b36";
+static const char col_gray3[] = "#93a1a1";
+static const char col_gray4[] = "#93a1a1";
+static const char col_cyan[] = "#002b36";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
@@ -19,28 +43,27 @@
};
/* tagging */
-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+static const char *tags[] = {
+ "sun", "mercury", "venus", "earth", "mars",
+ "jupiter", "saturn", "uranus", "neptune"
+};
-static const Rule rules[] = {
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+static Rule rules[] = {
+ /* class instance title tags mask isfloating monitor */
+ { NULL, NULL, NULL, 0, False, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
-static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
+ /* symbol arrange function */
+ { "[tile]", tile },
+ { "[float]", NULL },
+ { "[full]", monocle },
+ { "[grid]", grid},
};
/* key definitions */
@@ -76,6 +99,7 @@
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_g, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
--- a/config.mk Sun Jan 01 00:00:00 2019
+++ b/config.mk Sun Jan 01 00:00:01 2019
@@ -16,9 +14,9 @@
# freetype
FREETYPELIBS = -lfontconfig -lXft
-FREETYPEINC = /usr/include/freetype2
-# OpenBSD (uncomment)
-#FREETYPEINC = ${X11INC}/freetype2
+#FREETYPEINC = /usr/include/freetype2
+# OpenBSD
+FREETYPEINC = ${X11INC}/freetype2
# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC}
@@ -26,13 +24,16 @@
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
-#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
-CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
+CFLAGS = -std=c99 -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} \
+ -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -O3 -pipe \
+ -Wpedantic -Wall -Wextra -Wconversion -Wsign-conversion \
+ -Wformat -Wformat-security -Werror=format-security \
+ -Wstack-protector -fstack-protector-all \
+ --param ssp-buffer-size=1 \
+ -fasynchronous-unwind-tables \
+ -fexceptions -fpie -fpic \
+ -ftrapv -flto -fvisibility=hidden
+
LDFLAGS = ${LIBS}
-# Solaris
-#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
-#LDFLAGS = ${LIBS}
-
-# compiler and linker
CC = cc