config.def.h
1/* See LICENSE file for copyright and license details. */
2#define COL_DEF "#000000"
3#define MODKEY Mod4Mask
4
5/* appearance */
6static unsigned int borderpx = 2; /* border pixel of windows */
7static unsigned int snap = 32; /* snap pixel */
8static unsigned int gap = 0; /* inner and outer gap between windows */
9static int showbar = 1; /* 0 means no bar */
10static int topbar = 1; /* 0 means bottom bar */
11static int viewontag = 1;
12static int focusonwheel = 0;
13static char font[256] = "dnoxz_numerics:pixelsize=12:autohint=false";
14static char font_emoji[256] = "Noto Color Emoji:pixelsize=10:antialias=true:autohint=true";
15static char *fonts[] = { font, font_emoji };
16
17static char col_none[] = COL_DEF;
18static char col_nbr[] = COL_DEF;
19static char col_sbr[] = COL_DEF;
20static char col_sfl[] = COL_DEF;
21static char col_tanfg[] = COL_DEF;
22static char col_tanbg[] = COL_DEF;
23static char col_tanbr[] = COL_DEF;
24static char col_taifg[] = COL_DEF;
25static char col_taibg[] = COL_DEF;
26static char col_taibr[] = COL_DEF;
27static char col_tasfg[] = COL_DEF;
28static char col_tasbg[] = COL_DEF;
29static char col_tasbr[] = COL_DEF;
30static char col_layfg[] = COL_DEF;
31static char col_laybg[] = COL_DEF;
32static char col_laybr[] = COL_DEF;
33static char col_tinfg[] = COL_DEF;
34static char col_tinbg[] = COL_DEF;
35static char col_tisfg[] = COL_DEF;
36static char col_tisbg[] = COL_DEF;
37static char col_wmifg[] = COL_DEF;
38static char col_wmibg[] = COL_DEF;
39static char col_snfg[] = COL_DEF;
40static char col_snbg[] = COL_DEF;
41static char col_snofg[] = COL_DEF;
42static char col_snobg[] = COL_DEF;
43static char *colors[][4] = {
44 /* fg bg border float */
45 [SchemeNorm] = { col_none, col_none, col_nbr, col_none },
46 [SchemeSel] = { col_none, col_none, col_sbr, col_sfl },
47 [SchemeTagsNorm] = { col_tanfg, col_tanbg, col_tanbr, col_none },
48 [SchemeTagsIncl] = { col_taifg, col_taibg, col_taibr, col_none },
49 [SchemeTagsSel] = { col_tasfg, col_tasbg, col_tasbr, col_none },
50 [SchemeLayout] = { col_layfg, col_laybg, col_laybr, col_none },
51 [SchemeTitleNorm] = { col_tinfg, col_tinbg, col_none, col_none },
52 [SchemeTitleSel] = { col_tisfg, col_tisbg, col_none, col_none },
53 [SchemeWMIcon] = { col_wmifg, col_wmibg, col_none, col_none },
54
55 [SchemeStatusNorm] = { col_snfg, col_snbg, col_none, col_none },
56 [SchemeStatusNotify] = { col_snofg, col_snobg, col_none, col_none },
57};
58
59/* tagging */
60static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
61
62static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */
63static const unsigned int ulinestroke = 1; /* thickness / height of the underline */
64static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */
65static const char ptagf[] = "[%s: %s]"; /* format of a tag label */
66static const char etagf[] = "[%s]"; /* format of an empty tag */
67
68/* layout(s) */
69static int nmaster = 1; /* number of clients in master area */
70static int resizehints = 0; /* 1 means respect size hints in tiled resizals */
71
72static int i_basewidth = 30;
73static int i_wmicon[] = {4,0,3,3,8,4,3,3,0,8,3,3,4,8,3,3,8,8,3,3};
74static int i_nrowgrid[] = {0,1,7,4,8,1,6,4,0,6,4,3,5,6,4,3,10,6,4,3};
75static int i_monocle[] = {0,1,4,1,10,1,4,1,0,8,4,1,10,8,4,1,0,2,1,2,13,2,1,2,0,6,1,2,13,6,1,2};
76static int i_float[] = {0,1,10,2,0,3,3,3,4,4,10,5};
77
78static const Layout layouts[] = {
79 /* symbol arrange function */
80 [LayoutGrid] = { nrowgrid, i_nrowgrid, LENGTH(i_nrowgrid) }, /* default */
81 [LayoutMonocle] = { monocle, i_monocle, LENGTH(i_monocle) },
82 [LayoutFloating] = { NULL, i_float, LENGTH(i_float) }, /* no layout function means floating behavior */
83};
84
85/* context menu command used when right clicking root window */
86static const char *ctxmenucmd[] = { "appmenu", NULL };
87static const char *ctxmenucmd_alt[] = { "appmenu", "wmicon", NULL };
88
89/* button definitions */
90/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
91static Button buttons[] = {
92 /* click event mask button function argument */
93 { ClkLtSymbol, 0, Button1, rotatelayout, {.i = +1 } },
94 { ClkLtSymbol, 0, Button3, rotatelayout, {.i = -1 } },
95 { ClkClientWin, Mod4Mask, Button4, rotatestack, {.i = +1 } },
96 { ClkClientWin, Mod4Mask, Button5, rotatestack, {.i = -1 } },
97 { ClkWinTitle, 0, Button2, zoom, {0} },
98 { ClkClientWin, Mod4Mask, Button1, movemouse, {0} },
99 { ClkClientWin, Mod4Mask, Button2, togglefloating, {0} },
100 { ClkClientWin, Mod4Mask, Button3, resizemouse, {0} },
101 { ClkTagBar, 0, Button1, view, {0} },
102 { ClkTagBar, 0, Button3, toggleview, {0} },
103 { ClkTagBar, Mod4Mask, Button1, tag, {0} },
104 { ClkTagBar, 0, Button2, tag, {0} },
105 { ClkTagBar, Mod4Mask, Button3, toggletag, {0} },
106 { ClkWMIcon, 0, Button3, spawn, {.v = ctxmenucmd_alt } },
107 { ClkRootWin, 0, Button3, spawn, {.v = ctxmenucmd } },
108};
109
110/* Xresources preferences to load at startup */
111ResourcePref resources[] = {
112 { "normalBorderColor", STRING, &col_nbr },
113 { "selectedBorderColor", STRING, &col_sbr },
114 { "selectedFloatColor", STRING, &col_sfl },
115 { "tagsNormalForeground", STRING, &col_tanfg },
116 { "tagsNormalBackground", STRING, &col_tanbg },
117 { "tagsNormalBorderColor", STRING, &col_tanbr },
118 { "tagsIncludedForeground", STRING, &col_taifg },
119 { "tagsIncludedBackground", STRING, &col_taibg },
120 { "tagsIncludedBorderColor", STRING, &col_taibr },
121 { "tagsSelectedForeground", STRING, &col_tasfg },
122 { "tagsSelectedBackground", STRING, &col_tasbg },
123 { "tagsSelectedBorderColor", STRING, &col_tasbr },
124 { "layoutsForeground", STRING, &col_layfg },
125 { "layoutsBackground", STRING, &col_laybg },
126 { "layoutsBorderColor", STRING, &col_laybr },
127 { "titleNormalForeground", STRING, &col_tinfg },
128 { "titleNormalBackground", STRING, &col_tinbg },
129 { "titleSelectedForeground", STRING, &col_tisfg },
130 { "titleSelectedBackground", STRING, &col_tisbg },
131 { "wmIconForeground", STRING, &col_wmifg },
132 { "wmIconBackground", STRING, &col_wmibg },
133 { "statusNormalForeground", STRING, &col_snfg },
134 { "statusNormalBackground", STRING, &col_snbg },
135 { "statusNotifyForeground", STRING, &col_snofg },
136 { "statusNotifyBackground", STRING, &col_snobg },
137 { "font", STRING, &font },
138 { "fontEmoji", STRING, &font_emoji },
139 { "borderpx", INTEGER, &borderpx },
140 { "snap", INTEGER, &snap },
141 { "gap", INTEGER, &gap },
142 { "showbar", INTEGER, &showbar },
143 { "topbar", INTEGER, &topbar },
144 { "viewontag", INTEGER, &viewontag },
145 { "focusonwheel", INTEGER, &focusonwheel },
146 { "nmaster", INTEGER, &nmaster },
147 { "resizehints", INTEGER, &resizehints },
148};
149
150static const char *dwmfifo = "/tmp/dwm.fifo";
151static Command commands[] = {
152 { "spawn ...", spawn, {.i = DispCmdLine} },
153 { "quit", quit, {0} },
154 { "toggle bar", togglebar, {0} },
155 { "focus stack +", focusstack, {.i = +1} },
156 { "focus stack -", focusstack, {.i = -1} },
157 { "move stack +", movestack, {.i = +1} },
158 { "move stack -", movestack, {.i = -1} },
159 { "rotate stack +", rotatestack, {.i = +1} },
160 { "rotate stack -", rotatestack, {.i = -1} },
161 { "inc nmaster +", incnmaster, {.i = +1} },
162 { "inc nmaster -", incnmaster, {.i = -1} },
163 { "zoom", zoom, {0} },
164 { "kill client", killclient, {0} },
165 { "set status ...", setstatus, {.i = DispCmdLine} },
166
167 { "set layout grid", setlayout, {.v = &layouts[LayoutGrid]} },
168 { "set layout floating",setlayout, {.v = &layouts[LayoutFloating]} },
169 { "set layout monocle", setlayout, {.v = &layouts[LayoutMonocle]} },
170 { "toggle monocle", togglelayout, {.v = &layouts[LayoutMonocle]} },
171 { "toggle layout", setlayout, {0} },
172 { "rotate layout +", rotatelayout, {.i = +1} },
173 { "rotate layout -", rotatelayout, {.i = -1} },
174
175 { "toggle gaps", togglegaps, {0} },
176 { "inc gaps +", incgaps, {.i = +1} },
177 { "inc gaps -", incgaps, {.i = -1} },
178
179 { "toggle floating", togglefloating, {0} },
180 { "toggle sticky", togglesticky, {0} },
181 { "focus mon +", focusmon, {.i = +1} },
182 { "focus mon -", focusmon, {.i = -1} },
183 { "tag mon +", tagmon, {.i = +1} },
184 { "tag mon -", tagmon, {.i = -1} },
185
186 { "view", view, {0} },
187 { "view all", view, {.ui = ~0} },
188 { "tag all", tag, {.ui = ~0} },
189 { "view ...", view, {.i = DispUi} },
190 { "toggle view ...", toggleview, {.i = DispUi} },
191 { "tag ...", tag, {.i = DispUi} },
192 { "toggle tag ...", toggletag, {.i = DispUi} },
193};