gappx from xresources
[dwm.git] / config.def.h
1 /* See LICENSE file for copyright and license details. */
2
3 /* appearance */
4 static unsigned int borderpx  = 1;        /* border pixel of windows */
5 static unsigned int gappx     = 5;        /* gaps between windows */
6 static unsigned int snap      = 32;       /* snap pixel */
7 static const int swallowfloating    = 1;        /* 1 means swallow floating windows by default */
8 static int showbar            = 1;        /* 0 means no bar */
9 static int topbar             = 1;        /* 0 means bottom bar */
10 static const int vertpad            = 5;       /* vertical padding of bar */
11 static const int sidepad            = 5;       /* horizontal padding of bar */
12 static const char *fonts[]          = { "Source Code Pro:size=12" };
13 static const char dmenufont[]       = "Source Code Pro:size=12";
14 static char normbgcolor[]           = "#222222";
15 static char normbordercolor[]       = "#444444";
16 static char normfgcolor[]           = "#bbbbbb";
17 static char selfgcolor[]            = "#eeeeee";
18 static char selbordercolor[]        = "#005577";
19 static char selbgcolor[]            = "#005577";
20 static char *colors[][3] = {
21        /*               fg           bg           border   */
22        [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
23        [SchemeSel]  = { selfgcolor,  selbgcolor,  selbordercolor  },
24 };
25
26 /* tagging */
27 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
28
29 static const Rule rules[] = {
30         /* xprop(1):
31          *      WM_CLASS(STRING) = instance, class
32          *      WM_NAME(STRING) = title
33          */
34         /* class     instance  title           tags mask  isfloating  isterminal  noswallow  monitor */
35         { "Gimp",    NULL,     NULL,           0,         1,          0,           0,        -1 },
36         { "Firefox", NULL,     NULL,           1 << 8,    0,          0,          -1,        -1 },
37         { "St",      NULL,     NULL,           0,         0,          1,           0,        -1 },
38         { NULL,      NULL,     "Event Tester", 0,         0,          0,           1,        -1 }, /* xev */
39 };
40
41 /* layout(s) */
42 static float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
43 static int nmaster     = 1;    /* number of clients in master area */
44 static int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
45
46 static const Layout layouts[] = {
47         /* symbol     arrange function */
48         { "[]=",      tile },    /* first entry is default */
49         { "><>",      NULL },    /* no layout function means floating behavior */
50         { "[M]",      monocle },
51 };
52
53 /* key definitions */
54 #define MODKEY Mod1Mask
55 #define TAGKEYS(KEY,TAG) \
56         { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
57         { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
58         { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
59         { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
60
61 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
62 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
63
64 /* commands */
65 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
66 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon };
67 static const char *termcmd[]  = { "st", NULL };
68
69 /*
70  * Xresources preferences to load at startup
71  */
72 ResourcePref resources[] = {
73                 { "normbgcolor",        STRING,  &normbgcolor },
74                 { "normbordercolor",    STRING,  &normbordercolor },
75                 { "normfgcolor",        STRING,  &normfgcolor },
76                 { "selbgcolor",         STRING,  &selbgcolor },
77                 { "selbordercolor",     STRING,  &selbordercolor },
78                 { "selfgcolor",         STRING,  &selfgcolor },
79                 { "borderpx",           INTEGER, &borderpx },
80                 { "snap",                       INTEGER, &snap },
81                 { "showbar",            INTEGER, &showbar },
82                 { "topbar",             INTEGER, &topbar },
83                 { "nmaster",            INTEGER, &nmaster },
84                 { "resizehints",        INTEGER, &resizehints },
85                 { "mfact",                      FLOAT,   &mfact },
86                 { "gappx",                      INTEGER, &gappx },
87 };
88
89 static Key keys[] = {
90         /* modifier                     key        function        argument */
91         { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
92         { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
93         { MODKEY,                       XK_b,      togglebar,      {0} },
94         { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
95         { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
96         { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
97         { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
98         { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
99         { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
100         { MODKEY,                       XK_space,  zoom,           {0} },
101         { MODKEY,                       XK_Tab,    view,           {0} },
102         { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
103         { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
104         { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
105         { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
106         /* { MODKEY,                       XK_space,  setlayout,      {0} }, */
107         { MODKEY|ShiftMask,             XK_f,      togglefloating, {0} },
108         { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
109         { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
110         { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
111         { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
112         { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
113         { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
114         TAGKEYS(                        XK_1,                      0)
115         TAGKEYS(                        XK_2,                      1)
116         TAGKEYS(                        XK_3,                      2)
117         TAGKEYS(                        XK_4,                      3)
118         TAGKEYS(                        XK_5,                      4)
119         TAGKEYS(                        XK_6,                      5)
120         TAGKEYS(                        XK_7,                      6)
121         TAGKEYS(                        XK_8,                      7)
122         TAGKEYS(                        XK_9,                      8)
123         { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
124 };
125
126 /* button definitions */
127 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
128 static Button buttons[] = {
129         /* click                event mask      button          function        argument */
130         { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
131         { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
132         { ClkWinTitle,          0,              Button2,        zoom,           {0} },
133         { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
134         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
135         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
136         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
137         { ClkTagBar,            0,              Button1,        view,           {0} },
138         { ClkTagBar,            0,              Button3,        toggleview,     {0} },
139         { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
140         { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
141 };
142