master
1/* See LICENSE file for copyright and license details. */
2
3/* appearance */
4static const char *fonts[] = {
5 "monospace:size=8"
6};
7static const char dmenufont[] = "monospace:size=10";
8static const char normbordercolor[] = "#000000";
9static const char normbgcolor[] = "#222222";
10static const char normfgcolor[] = "#bbbbbb";
11static const char selbordercolor[] = "#222222";
12static const char selbgcolor[] = "#005577";
13static const char selfgcolor[] = "#eeeeee";
14static const unsigned int borderpx = 1; /* border pixel of windows */
15static const unsigned int snap = 32; /* snap pixel */
16static const int showbar = 0; /* 0 means no bar */
17static const int topbar = 1; /* 0 means bottom bar */
18
19/* tagging */
20static const char *tags[] = { "t", "b"};
21
22static const Rule rules[] = {
23 /* xprop(1):
24 * WM_CLASS(STRING) = instance, class
25 * WM_NAME(STRING) = title
26 */
27 /* class instance title tags mask isfloating monitor */
28 { "Firefox", NULL, NULL, 1, 0, -1 },
29};
30
31/* layout(s) */
32static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
33static const int nmaster = 1; /* number of clients in master area */
34static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
35
36static const Layout layouts[] = {
37 /* symbol arrange function */
38 { "[]=", tile }, /* first entry is default */
39 { "[M]", monocle },
40};
41
42/* key definitions */
43#define MODKEY Mod1Mask
44#define TAGKEYS(KEY,TAG) \
45 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
46 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
47 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
48 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
49
50/* helper for spawning shell commands in the pre dwm-5.0 fashion */
51#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
52
53/* commands */
54static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
55static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
56static const char *termcmd[] = { "st", NULL };
57static const char *browser[] = { "chromium-browser", NULL };
58static const char *bldec[] = { "xbacklight", "-", "1"};
59static const char *blinc[] = { "xbacklight", "+", "1"};
60static const char *blmin[] = { "xbacklight", "-set", "1"};
61static const char *blmax[] = { "xbacklight", "-set", "100"};
62
63static Key keys[] = {
64 /* modifier key function argument */
65 { MODKEY, XK_p, spawn, {.v = dmenucmd } },
66 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
67 { MODKEY|ShiftMask, XK_b, spawn, {.v = browser } },
68 { MODKEY, XK_F6, spawn, {.v = bldec } },
69 { MODKEY, XK_F7, spawn, {.v = blinc } },
70 { MODKEY|ShiftMask, XK_F6, spawn, {.v = blmin } },
71 { MODKEY|ShiftMask, XK_F7, spawn, {.v = blmax } },
72 { MODKEY, XK_b, togglebar, {0} },
73 { MODKEY, XK_j, focusstack, {.i = +1 } },
74 { MODKEY, XK_k, focusstack, {.i = -1 } },
75 { MODKEY, XK_i, incnmaster, {.i = +1 } },
76 { MODKEY, XK_d, incnmaster, {.i = -1 } },
77 { MODKEY, XK_h, setmfact, {.f = -0.05} },
78 { MODKEY, XK_l, setmfact, {.f = +0.05} },
79 { MODKEY, XK_Return, zoom, {0} },
80 { MODKEY, XK_Tab, view, {0} },
81 { MODKEY|ShiftMask, XK_c, killclient, {0} },
82 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
83 { MODKEY, XK_m, setlayout, {.v = &layouts[1]} },
84 { MODKEY, XK_space, setlayout, {0} },
85 { MODKEY, XK_0, view, {.ui = ~0 } },
86 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
87 { MODKEY, XK_comma, focusmon, {.i = -1 } },
88 { MODKEY, XK_period, focusmon, {.i = +1 } },
89 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
90 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
91 TAGKEYS( XK_1, 0)
92 TAGKEYS( XK_2, 1)
93 TAGKEYS( XK_3, 2)
94 TAGKEYS( XK_4, 3)
95 TAGKEYS( XK_5, 4)
96 TAGKEYS( XK_6, 5)
97 TAGKEYS( XK_7, 6)
98 TAGKEYS( XK_8, 7)
99 TAGKEYS( XK_9, 8)
100 { MODKEY|ShiftMask, XK_q, quit, {0} },
101};
102
103/* button definitions */
104/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
105static Button buttons[] = {
106 /* click event mask button function argument */
107 { ClkLtSymbol, 0, Button1, setlayout, {0} },
108 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
109 { ClkWinTitle, 0, Button2, zoom, {0} },
110 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
111 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
112 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
113 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
114 { ClkTagBar, 0, Button1, view, {0} },
115 { ClkTagBar, 0, Button3, toggleview, {0} },
116 { ClkTagBar, MODKEY, Button1, tag, {0} },
117 { ClkTagBar, MODKEY, Button3, toggletag, {0} },
118};
119