dwm

My fork of dwm.
git clone git://git.alex.balgavy.eu/dwm.git
Log | Files | Refs | README | LICENSE

config.def.h (10428B)


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