config.def.h (10584B)
1 /* See LICENSE file for copyright and license details. */ 2 3 /* appearance */ 4 static const unsigned int borderpx = 1; /* border pixel of windows */ 5 static const unsigned int snap = 32; /* snap pixel */ 6 static const unsigned int gappih = 20; /* horiz inner gap between windows */ 7 static const unsigned int gappiv = 10; /* vert inner gap between windows */ 8 static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ 9 static const unsigned int gappov = 30; /* vert outer gap between windows and screen edge */ 10 static int smartgaps = 0; /* 1 means no outer gap when there is only one window */ 11 static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ 12 static const int showbar = 1; /* 0 means no bar */ 13 static const int topbar = 1; /* 0 means bottom bar */ 14 static char font[] = "monospace:size=10"; 15 static char dmenufont[] = "monospace:size=10"; 16 static const char *fonts[] = { font }; 17 static char normbgcolor[] = "#222222"; 18 static char normbordercolor[] = "#444444"; 19 static char normfgcolor[] = "#bbbbbb"; 20 static char selfgcolor[] = "#eeeeee"; 21 static char selbordercolor[] = "#005577"; 22 static char selbgcolor[] = "#005577"; 23 static char *colors[][3] = { 24 /* fg bg border */ 25 [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, 26 [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, 27 }; 28 static const XPoint stickyicon[] = { {0,0}, {4,0}, {4,8}, {2,6}, {0,8}, {0,0} }; /* represents the icon as an array of vertices */ 29 static const XPoint stickyiconbb = {4,8}; /* defines the bottom right corner of the polygon's bounding box (speeds up scaling) */ 30 31 /* tagging */ 32 #define MAX_TAGNAME_LEN 14 /* excludes TAG_PREPEND */ 33 #define TAG_PREPEND "%1i:" /* formatted as 2 chars */ 34 #define MAX_TAGLEN 16 /* altogether */ 35 static char tags[][MAX_TAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 36 37 static const Rule rules[] = { 38 /* xprop(1): 39 * WM_CLASS(STRING) = instance, class 40 * WM_NAME(STRING) = title 41 */ 42 /* class instance title tags mask isfloating isterminal noswallow monitor */ 43 { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, 44 { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, 45 { "St", NULL, NULL, 0, 0, 1, 0, -1 }, 46 { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ 47 }; 48 49 /* layout(s) */ 50 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 51 static const int nmaster = 1; /* number of clients in master area */ 52 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 53 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 54 55 #define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */ 56 #include "vanitygaps.c" 57 58 static const Layout layouts[] = { 59 /* symbol arrange function */ 60 { "[]=", tile }, /* first entry is default */ 61 { "[M]", monocle }, 62 { "[@]", spiral }, 63 { "[\\]", dwindle }, 64 { "H[]", deck }, 65 { "TTT", bstack }, 66 { "===", bstackhoriz }, 67 { "HHH", grid }, 68 { "###", nrowgrid }, 69 { "---", horizgrid }, 70 { ":::", gaplessgrid }, 71 { "|M|", centeredmaster }, 72 { ">M>", centeredfloatingmaster }, 73 { "><>", NULL }, /* no layout function means floating behavior */ 74 { NULL, NULL }, 75 }; 76 77 /* key definitions */ 78 #define MODKEY Mod1Mask 79 #define TAGKEYS(KEY,TAG) \ 80 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 81 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 82 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 83 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 84 #define STACKKEYS(MOD,ACTION) \ 85 { MOD, XK_j, ACTION##stack, {.i = INC(+1) } }, \ 86 { MOD, XK_k, ACTION##stack, {.i = INC(-1) } }, \ 87 { MOD, XK_grave, ACTION##stack, {.i = PREVSEL } }, \ 88 { MOD, XK_q, ACTION##stack, {.i = 0 } }, \ 89 { MOD, XK_a, ACTION##stack, {.i = 1 } }, \ 90 { MOD, XK_z, ACTION##stack, {.i = 2 } }, \ 91 { MOD, XK_x, ACTION##stack, {.i = -1 } }, 92 93 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 94 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 95 96 /* commands */ 97 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 98 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL }; 99 static const char *termcmd[] = { "st", NULL }; 100 101 /* 102 * Xresources preferences to load at startup 103 */ 104 ResourcePref resources[] = { 105 { "font", STRING, &font }, 106 { "dmenufont", STRING, &dmenufont }, 107 { "normbgcolor", STRING, &normbgcolor }, 108 { "normbordercolor", STRING, &normbordercolor }, 109 { "normfgcolor", STRING, &normfgcolor }, 110 { "selbgcolor", STRING, &selbgcolor }, 111 { "selbordercolor", STRING, &selbordercolor }, 112 { "selfgcolor", STRING, &selfgcolor }, 113 { "borderpx", INTEGER, &borderpx }, 114 { "snap", INTEGER, &snap }, 115 { "showbar", INTEGER, &showbar }, 116 { "topbar", INTEGER, &topbar }, 117 { "nmaster", INTEGER, &nmaster }, 118 { "resizehints", INTEGER, &resizehints }, 119 { "mfact", FLOAT, &mfact }, 120 }; 121 122 static Key keys[] = { 123 /* modifier key function argument */ 124 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 125 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 126 { MODKEY, XK_b, togglebar, {0} }, 127 STACKKEYS(MODKEY, focus) 128 STACKKEYS(MODKEY|ShiftMask, push) 129 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 130 { MODKEY, XK_d, incnmaster, {.i = -1 } }, 131 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 132 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 133 { MODKEY, XK_Return, zoom, {0} }, 134 { MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } }, 135 { MODKEY|Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } }, 136 { MODKEY|Mod4Mask, XK_i, incrigaps, {.i = +1 } }, 137 { MODKEY|Mod4Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } }, 138 { MODKEY|Mod4Mask, XK_o, incrogaps, {.i = +1 } }, 139 { MODKEY|Mod4Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } }, 140 { MODKEY|Mod4Mask, XK_6, incrihgaps, {.i = +1 } }, 141 { MODKEY|Mod4Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } }, 142 { MODKEY|Mod4Mask, XK_7, incrivgaps, {.i = +1 } }, 143 { MODKEY|Mod4Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } }, 144 { MODKEY|Mod4Mask, XK_8, incrohgaps, {.i = +1 } }, 145 { MODKEY|Mod4Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } }, 146 { MODKEY|Mod4Mask, XK_9, incrovgaps, {.i = +1 } }, 147 { MODKEY|Mod4Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } }, 148 { MODKEY|Mod4Mask, XK_0, togglegaps, {0} }, 149 { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} }, 150 { MODKEY, XK_Tab, view, {0} }, 151 { MODKEY|ShiftMask, XK_c, killclient, {0} }, 152 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 153 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 154 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 155 { MODKEY, XK_space, setlayout, {0} }, 156 { MODKEY|ShiftMask, XK_f, togglefakefullscreen, {0} }, 157 { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 158 { MODKEY, XK_0, view, {.ui = ~0 } }, 159 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 160 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 161 { MODKEY, XK_period, focusmon, {.i = +1 } }, 162 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 163 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 164 TAGKEYS( XK_1, 0) 165 TAGKEYS( XK_2, 1) 166 TAGKEYS( XK_3, 2) 167 TAGKEYS( XK_4, 3) 168 TAGKEYS( XK_5, 4) 169 TAGKEYS( XK_6, 5) 170 TAGKEYS( XK_7, 6) 171 TAGKEYS( XK_8, 7) 172 TAGKEYS( XK_9, 8) 173 { MODKEY|ShiftMask, XK_BackSpace, quit, {0} }, 174 }; 175 176 /* button definitions */ 177 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 178 static Button buttons[] = { 179 /* click event mask button function argument */ 180 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 181 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 182 { ClkWinTitle, 0, Button2, zoom, {0} }, 183 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 184 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 185 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 186 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 187 { ClkTagBar, 0, Button1, view, {0} }, 188 { ClkTagBar, 0, Button3, toggleview, {0} }, 189 { ClkTagBar, MODKEY, Button1, tag, {0} }, 190 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 191 }; 192