config.h (8377B)
1 /* 2 * MIT/X Consortium License 3 * 4 * © 2006-2019 Anselm R Garbe <anselm@garbe.ca> 5 * © 2006-2009 Jukka Salmi <jukka at salmi dot ch> 6 * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com> 7 * © 2007-2011 Peter Hartlich <sgkkr at hartlich dot com> 8 * © 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com> 9 * © 2007-2009 Christof Musik <christof at sendfax dot de> 10 * © 2007-2009 Premysl Hruby <dfenze at gmail dot com> 11 * © 2007-2008 Enno Gottox Boland <gottox at s01 dot de> 12 * © 2008 Martin Hurton <martin dot hurton at gmail dot com> 13 * © 2008 Neale Pickett <neale dot woozle dot org> 14 * © 2009 Mate Nagy <mnagy at port70 dot net> 15 * © 2010-2016 Hiltjo Posthuma <hiltjo@codemadness.org> 16 * © 2010-2012 Connor Lane Smith <cls@lubutu.com> 17 * © 2011 Christoph Lohmann <20h@r-36.net> 18 * © 2015-2016 Quentin Rameau <quinq@fifth.space> 19 * © 2015-2016 Eric Pruitt <eric.pruitt@gmail.com> 20 * © 2016-2017 Markus Teich <markus.teich@stusta.mhn.de> 21 * © 2020-2022 Chris Down <chris@chrisdown.name> 22 * 23 * Permission is hereby granted, free of charge, to any person obtaining a 24 * copy of this software and associated documentation files (the "Software"), 25 * to deal in the Software without restriction, including without limitation 26 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 27 * and/or sell copies of the Software, and to permit persons to whom the 28 * Software is furnished to do so, subject to the following conditions: 29 * 30 * The above copyright notice and this permission notice shall be included in 31 * all copies or substantial portions of the Software. 32 * 33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 36 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 38 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 39 * DEALINGS IN THE SOFTWARE. 40 */ 41 42 /* appearance */ 43 static const unsigned int borderpx = 1; /* border pixel of windows */ 44 static const unsigned int snap = 32; /* snap pixel */ 45 static const int showbar = 1; /* 0 means no bar */ 46 static const int topbar = 1; /* 0 means bottom bar */ 47 static const char *fonts[] = { "monospace:size=10" }; 48 static const char dmenufont[] = "monospace:size=10"; 49 static const char col_gray1[] = "#000000"; 50 static const char col_gray2[] = "#444444"; 51 static const char col_gray3[] = "#ffffff"; 52 static const char col_cyan[] = "#005577"; 53 static const char *colors[][3] = { 54 /* fg bg border */ 55 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 56 [SchemeSel] = { col_gray3, col_cyan, col_cyan }, 57 }; 58 59 /* tagging */ 60 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 61 62 static const Rule rules[] = { 63 /* xprop(1): 64 * WM_CLASS(STRING) = instance, class 65 * WM_NAME(STRING) = title 66 */ 67 /* class instance title tags mask isfloating monitor */ 68 { "Gimp", NULL, NULL, 0, 1, -1 }, 69 { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, 70 }; 71 72 /* layout(s) */ 73 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 74 static const int nmaster = 1; /* number of clients in master area */ 75 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 76 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 77 78 static const Layout layouts[] = { 79 /* symbol arrange function */ 80 { "[M]", monocle }, 81 { "[]=", tile }, /* first entry is default */ 82 { "><>", NULL }, /* no layout function means floating behavior */ 83 }; 84 85 /* key definitions */ 86 #define MODKEY Mod1Mask 87 #define TAGKEYS(KEY,TAG) \ 88 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 89 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 90 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 91 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 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", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray3, NULL }; 99 static const char *termcmd[] = { "st", NULL }; 100 101 static const Key keys[] = { 102 /* modifier key function argument */ 103 { ControlMask, XK_Return, spawn, {.v = termcmd } }, 104 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 105 { MODKEY, XK_b, togglebar, {0} }, 106 { MODKEY, XK_j, focusstack, {.i = +1 } }, 107 { MODKEY, XK_k, focusstack, {.i = -1 } }, 108 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 109 { MODKEY, XK_d, incnmaster, {.i = -1 } }, 110 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 111 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 112 { MODKEY, XK_Return, zoom, {0} }, 113 { MODKEY, XK_Tab, view, {0} }, 114 { MODKEY, XK_BackSpace, killclient, {0} }, 115 { MODKEY, XK_m, setlayout, {.v = &layouts[0]} }, 116 { MODKEY, XK_t, setlayout, {.v = &layouts[1]} }, 117 { MODKEY, XK_f, setlayout, {.v = &layouts[2]} }, 118 { MODKEY, XK_space, setlayout, {0} }, 119 { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 120 { MODKEY, XK_0, view, {.ui = ~0 } }, 121 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 122 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 123 { MODKEY, XK_period, focusmon, {.i = +1 } }, 124 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 125 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 126 TAGKEYS( XK_1, 0) 127 TAGKEYS( XK_2, 1) 128 TAGKEYS( XK_3, 2) 129 TAGKEYS( XK_4, 3) 130 TAGKEYS( XK_5, 4) 131 TAGKEYS( XK_6, 5) 132 TAGKEYS( XK_7, 6) 133 TAGKEYS( XK_8, 7) 134 TAGKEYS( XK_9, 8) 135 { MODKEY|ShiftMask, XK_q, quit, {0} }, 136 }; 137 138 /* button definitions */ 139 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 140 static const Button buttons[] = { 141 /* click event mask button function argument */ 142 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 143 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 144 { ClkWinTitle, 0, Button2, zoom, {0} }, 145 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 146 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 147 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 148 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 149 { ClkTagBar, 0, Button1, view, {0} }, 150 { ClkTagBar, 0, Button3, toggleview, {0} }, 151 { ClkTagBar, MODKEY, Button1, tag, {0} }, 152 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 153 }; 154