-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.def.h
400 lines (361 loc) · 19.4 KB
/
config.def.h
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
/* See LICENSE file for copyright and license details. */
#define SESSION_FILE "/tmp/dwm-session"
/*
* APPEARANCE AND BEHAVIOR
*/
/* --configurable with Xresources-- */
/* appearance */
static unsigned int borderpx = 5; /* border pixel of windows */
static unsigned int snap = 32; /* snap pixel */
static int showbar = 1; /* 0 means no bar */
static int topbar = 1; /* 0 means bottom bar */
static int vertpad = 10; /* vertical padding of bar */
static int sidepad = 10; /* horizontal padding of bar */
static int user_bh = 23; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */
static int dmenu_bw = 5;
static char font[] = "monospace:size=10";
static char dmenufont[] = "monospace:size=10";
static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfgcolor[] = "#bbbbbb";
static char selfgcolor[] = "#eeeeee";
static char selbordercolor[] = "#005577";
static char selbgcolor[] = "#005577";
static char normmarkcolor[] = "#775500"; /*border color for marked client*/
static char selmarkcolor[] = "#775577"; /*border color for marked client on focus*/
/* tagging */
static char tagsyms[9][10] = { "", "", "", "", "", "", "", "", "" };
static char tagcolors[9][2][8] = {
{ "#ffffff", "#ff0000" },
{ "#ffffff", "#ff7f00" },
{ "#000000", "#ffff00" },
{ "#000000", "#00ff00" },
{ "#ffffff", "#0000ff" },
{ "#ffffff", "#4b0082" },
{ "#ffffff", "#9400d3" },
{ "#000000", "#ffffff" },
{ "#ffffff", "#000000" },
};
/* layout(s) */
static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static int nmaster = 1; /* number of clients in master area */
static int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static int attachdirection = 4; /* 0 default, 1 above, 2 aside, 3 below, 4 bottom, 5 top */
/* --constants-- */
#define ICONSIZE (bh - 4) /* icon size */
#define ICONSPACING 5 /* space between icon and title */
/* alt-tab configuration */
static const unsigned int tabModKey = 0x40; /* if this key is hold the alt-tab functionality stays acitve. This key must be the same as key that is used to active functin altTabStart `*/
static const unsigned int tabCycleKey = 0x17; /* if this key is hit the alt-tab program moves one position forward in clients stack. This key must be the same as key that is used to active functin altTabStart */
static const unsigned int tabReverseKey = 0x32; /* reverses alttab cycle */
static const unsigned int tabPosY = 1; /* tab position on Y axis, 0 = bottom, 1 = center, 2 = top */
static const unsigned int tabPosX = 1; /* tab position on X axis, 0 = left, 1 = center, 2 = right */
static const unsigned int maxWTab = 600; /* tab menu width */
static const unsigned int maxHTab = 200; /* tab menu height */
/* appearance */
static char *fonts[] = { font };
static const unsigned int gappih = 10; /* horiz inner gap between windows */
static const unsigned int gappiv = 10; /* vert inner gap between windows */
static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
/* systray */
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 2; /* systray spacing */
static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
static const int showsystray = 1; /* 0 means no systray */
/* colors */
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
[SchemeNormMark] = { normfgcolor, normbgcolor, normmarkcolor },
[SchemeSelMark] = { selfgcolor, selbgcolor, selmarkcolor },
};
/* alphas */
static const unsigned int alphas[][3] = {
/* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
[SchemeNormMark] = { OPAQUE, baralpha, borderalpha },
[SchemeSelMark] = { OPAQUE, baralpha, borderalpha },
};
static const unsigned int tagalpha[] = { OPAQUE, baralpha };
/* window swallowing */
static const int swaldecay = 3;
static const int swalretroactive = 1;
static const char swalsymbol[] = "ﳺ";
/* focus */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
/* tagging */
static const char *tags[] = { tagsyms[0], tagsyms[1], tagsyms[2], tagsyms[3], tagsyms[4], tagsyms[5], tagsyms[6], tagsyms[7], tagsyms[8] };
static const char *tagsel[][2] = {
{ tagcolors[0][0], tagcolors[0][1] },
{ tagcolors[1][0], tagcolors[1][1] },
{ tagcolors[2][0], tagcolors[2][1] },
{ tagcolors[3][0], tagcolors[3][1] },
{ tagcolors[4][0], tagcolors[4][1] },
{ tagcolors[5][0], tagcolors[5][1] },
{ tagcolors[6][0], tagcolors[6][1] },
{ tagcolors[7][0], tagcolors[7][1] },
{ tagcolors[8][0], tagcolors[8][1] },
};
/* layout(s) */
#define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */
#include "vanitygaps.c"
#include "exitdwm.c"
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "[M]", monocle },
{ "[\\]", dwindle },
{ "HHH", grid },
{ "###", nrowgrid },
{ "---", horizgrid },
{ ":::", gaplessgrid },
{ "|M|", centeredmaster },
{ ">M>", centeredfloatingmaster },
{ "><>", NULL }, /* no layout function means floating behavior */
{ NULL, NULL },
};
/*
* Xresources preferences to load at startup
*/
ResourcePref resources[] = {
// fonts
{ "font", STRING, &font },
{ "dmenufont", STRING, &dmenufont },
// colors
{ "normbgcolor", STRING, &normbgcolor },
{ "normbordercolor", STRING, &normbordercolor },
{ "normfgcolor", STRING, &normfgcolor },
{ "selbgcolor", STRING, &selbgcolor },
{ "selbordercolor", STRING, &selbordercolor },
{ "selfgcolor", STRING, &selfgcolor },
{ "normmarkcolor", STRING, &normmarkcolor },
{ "selmarkcolor", STRING, &selmarkcolor },
// tag colors
{ "tag1fg", STRING, &tagcolors[0][0] },
{ "tag1bg", STRING, &tagcolors[0][1] },
{ "tag2fg", STRING, &tagcolors[1][0] },
{ "tag2bg", STRING, &tagcolors[1][1] },
{ "tag3fg", STRING, &tagcolors[2][0] },
{ "tag3bg", STRING, &tagcolors[2][1] },
{ "tag4fg", STRING, &tagcolors[3][0] },
{ "tag4bg", STRING, &tagcolors[3][1] },
{ "tag5fg", STRING, &tagcolors[4][0] },
{ "tag5bg", STRING, &tagcolors[4][1] },
{ "tag6fg", STRING, &tagcolors[5][0] },
{ "tag6bg", STRING, &tagcolors[5][1] },
{ "tag7fg", STRING, &tagcolors[6][0] },
{ "tag7bg", STRING, &tagcolors[6][1] },
{ "tag8fg", STRING, &tagcolors[7][0] },
{ "tag8bg", STRING, &tagcolors[7][1] },
{ "tag9fg", STRING, &tagcolors[8][0] },
{ "tag9bg", STRING, &tagcolors[8][1] },
// tag icon
{ "tag1sym", STRING, &tagsyms[0] },
{ "tag2sym", STRING, &tagsyms[1] },
{ "tag3sym", STRING, &tagsyms[2] },
{ "tag4sym", STRING, &tagsyms[3] },
{ "tag5sym", STRING, &tagsyms[4] },
{ "tag6sym", STRING, &tagsyms[5] },
{ "tag7sym", STRING, &tagsyms[6] },
{ "tag8sym", STRING, &tagsyms[7] },
{ "tag9sym", STRING, &tagsyms[8] },
// misc
{ "borderpx", INTEGER, &borderpx },
{ "barheight", INTEGER, &user_bh },
{ "topbar", INTEGER, &topbar },
{ "showbar", INTEGER, &showbar },
{ "vertpad", INTEGER, &vertpad },
{ "sidepad", INTEGER, &sidepad },
{ "snap", INTEGER, &snap },
{ "resizehints", INTEGER, &resizehints },
{ "nmaster", INTEGER, &nmaster },
{ "attachdirection", INTEGER, &attachdirection },
{ "mfact", FLOAT, &mfact },
};
/*
* RULES
*/
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor float x,y,w,h isfakefullscreen*/
//{ "Gimp", NULL, NULL, 0, 1, -1, 50,50,500,500, 0 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1, 50,50,500,500, 0 },
};
static const MonitorRule monrules[] = {
/* monitor tag layout mfact nmaster showbar topbar */
//{ 1, -1, 2, -1, -1, -1, -1 }, // use a different layout for the second monitor
{ -1, -1, 0, -1, -1, -1, -1 } // default (keep it last)
};
/*
* KEYBINDINGS
*/
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "tabbed_st", NULL };
static const char *filemanager[] = { "thunar", NULL };
static const char *browser[] = { "firefox", NULL };
static const char *layoutmenu_cmd = "layoutmenu.sh";
static const char *applaunchercmd[] = { "mcdmsc-applauncher", NULL };
static const char *powermenu[] = { "mcdmsc-powermenu", NULL };
static const char *volume[] = { "mcdmsc-volume", NULL };
static const char *togglemute[] = { "mcdmsc-volume", "tg", NULL };
static const char *volup[] = { "mcdmsc-volume", "up", "5", NULL };
static const char *volminup[] = { "mcdmsc-volume", "up", "1", NULL };
static const char *voldown[] = { "mcdmsc-volume", "down", "5", NULL };
static const char *volmindown[] = { "mcdmsc-volume", "down", "1", NULL };
/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
static const StatusCmd statuscmds[] = {
{ "notify-send Mouse$BUTTON", 1 },
};
static const char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };
static Key keys[] = {
/* modifier key function argument */
// Layouts
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[9]} },
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
{ MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
// mfact
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
// cfact
{ MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} },
{ MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
{ MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
// nmaster
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
// Gaps
{ MODKEY|Mod1Mask, XK_u, incrgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_i, incrigaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_o, incrogaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_6, incrihgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_7, incrivgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_8, incrohgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_9, incrovgaps, {.i = +1 } },
{ MODKEY|Mod1Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
{ MODKEY|Mod1Mask, XK_0, togglegaps, {0} },
{ MODKEY|Mod1Mask|ShiftMask, XK_0, defaultgaps, {0} },
{ MODKEY, XK_b, togglebar, {0} },
// Launchers
{ MODKEY, XK_space, rundmenu, {.v = "mcdmsc-applauncher" } },
{ MODKEY|ControlMask, XK_space, rundmenu, {.v = "dwm-dmenu_run" } },
{ MODKEY|ControlMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ControlMask, XK_f, spawn, {.v = filemanager } },
{ MODKEY|ControlMask, XK_b, spawn, {.v = browser } },
// Volume
{ MODKEY|ControlMask, XK_p, spawn, {.v = volume } },
{ MODKEY|ControlMask, XK_m, spawn, {.v = togglemute } },
{ MODKEY|ControlMask, XK_Up, spawn, {.v = volup } },
{ MODKEY|ControlMask, XK_Down, spawn, {.v = voldown } },
{ MODKEY|ShiftMask|ControlMask, XK_Up, spawn, {.v = volminup } },
{ MODKEY|ShiftMask|ControlMask, XK_Down, spawn, {.v = volmindown } },
// Focus
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY, XK_u, swapclient, {0} },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_m, togglemark, {0} },
{ MODKEY|ShiftMask|ControlMask, XK_o, swapfocus, {0} },
// Windows
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_Return, zoom, {0} },
{ Mod1Mask, XK_Tab, altTabStart, {.i = +1 } },
{ Mod1Mask|ShiftMask, XK_Tab, altTabStart, {.i = -1 } },
{ MODKEY|ControlMask, XK_j, pushdown, {0} },
{ MODKEY|ControlMask, XK_k, pushup, {0} },
{ MODKEY|ControlMask, XK_c, killclient, {0} },
{ MODKEY|Mod1Mask, XK_k, killclient, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
// Tags
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY, XK_o, winview, {0} },
{ MODKEY, XK_Right, viewnext, {0} },
{ MODKEY, XK_Left, viewprev, {0} },
{ MODKEY|ControlMask, XK_Right, viewnext, {0} },
{ MODKEY|ControlMask, XK_Left, viewprev, {0} },
{ MODKEY|ControlMask, XK_l, viewnext, {0} },
{ MODKEY|ControlMask, XK_h, viewprev, {0} },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY|Mod1Mask, XK_Tab, view, {0} },
{ MODKEY|Mod1Mask, XK_Right, tagtonext, {0} },
{ MODKEY|Mod1Mask, XK_Left, tagtoprev, {0} },
{ MODKEY|ControlMask|Mod1Mask, XK_Right, tagtonext, {0} },
{ MODKEY|ControlMask|Mod1Mask, XK_Left, tagtoprev, {0} },
{ MODKEY|ControlMask|Mod1Mask, XK_l, tagtonext, {0} },
{ MODKEY|ControlMask|Mod1Mask, XK_h, tagtoprev, {0} },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
// Scratchpad
{ MODKEY|ControlMask|ShiftMask, XK_Tab, scratchpad_show, {0} },
{ MODKEY|ControlMask|ShiftMask, XK_h, scratchpad_hide, {0} },
{ MODKEY|ControlMask|ShiftMask, XK_c, scratchpad_remove,{0} },
// Quit
{ MODKEY, XK_q, exitdwm, {0} },
{ MODKEY, XK_p, spawn, {.v = powermenu } },
{ MODKEY|ShiftMask, XK_q, quit, {1} },
{ MODKEY|ControlMask|ShiftMask, XK_q, quit, {0} },
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, layoutmenu, {0} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button1, spawn, {.v = statuscmd } },
{ ClkStatusText, 0, Button2, spawn, {.v = statuscmd } },
{ ClkStatusText, 0, Button3, spawn, {.v = statuscmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkClientWin, MODKEY|ShiftMask, Button1, swalmouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
/*
* SIGNALS
*/
/* signum must be greater than 0 */
/* trigger signals using `xsetroot -name "fsignal:<signum>"` */
static Signal signals[] = {
/* signum function argument */
{ 1, setlayout, {.v = 0} },
};