dwm

dynamic window manager
git clone git://mfeller.io/dwm.git
Log | Files | Refs | README | LICENSE

config.def.h (5491B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 2;        /* border pixel of windows */
      5 static const unsigned int gappx     = 5;       /* gaps between windows */
      6 static const unsigned int snap      = 32;       /* snap pixel */
      7 static const int showbar            = 0;        /* 0 means no bar */
      8 static const int topbar             = 1;        /* 0 means bottom bar */
      9 static const char *fonts[]          = { "Fira Mono:size=11" };
     10 static const char col_gray1[]       = "#222222";
     11 static const char col_gray2[]       = "#161819";
     12 static const char col_gray3[]       = "#bbbbbb";
     13 static const char col_gray4[]       = "#eeeeee";
     14 static const char col_border[]      = "#aaaaaa";
     15 static const char *colors[][3]      = {
     16 	/*               fg         bg         border      */
     17 	[SchemeNorm] = { col_gray3, col_gray1,  col_gray2  },
     18 	[SchemeSel]  = { col_gray4, col_border, col_border },
     19 };
     20 
     21 /* tagging */
     22 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     23 
     24 static const Rule rules[] = {
     25 	/* xprop(1):
     26 	 *	WM_CLASS(STRING) = instance, class
     27 	 *	WM_NAME(STRING) = title
     28 	 */
     29 	/* class      instance    title       tags mask     iscentered   isfloating   isterminal noswallow monitor */
     30 	{ "Gimp",     NULL,       NULL,       0,            0,           1,           0,         0,        -1 },
     31 	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           0,           0,         0,        -1 },
     32 	{ "st",       NULL,       NULL,       0,            0,           0,           1,         1,        -1 },
     33 	{ "Center",   NULL,       NULL,       0,            1,           1,           0,         0,        -1 },
     34 };
     35 
     36 /* layout(s) */
     37 static const float mfact     = 0.4;  /* factor of master area size [0.05..0.95] */
     38 static const int nmaster     = 1;    /* number of clients in master area */
     39 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     40 
     41 static const Layout layouts[] = {
     42 	/* symbol     arrange function */
     43 	{ "[]=",      tile },    /* first entry is default */
     44 	{ "><>",      NULL },    /* no layout function means floating behavior */
     45 	{ "[M]",      monocle },
     46 };
     47 
     48 /* key definitions */
     49 #define MODKEY Mod4Mask
     50 #define TAGKEYS(KEY,TAG) \
     51 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     52 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     53 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     54 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     55 
     56 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     57 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     58 
     59 /* commands */
     60 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     61 static const char *termcmd[]  = { "st", "-w", "''", "-e", NULL };
     62 static const char *dmenucmd[] = { "dwm_run", NULL };
     63 
     64 static Key keys[] = {
     65 	/* modifier                     key        function        argument */
     66 	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
     67 	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
     68 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     69 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     70 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     71 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     72 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     73 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
     74 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
     75 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
     76 	TAGKEYS(                        XK_1,                      0)
     77 	TAGKEYS(                        XK_2,                      1)
     78 	TAGKEYS(                        XK_3,                      2)
     79 	TAGKEYS(                        XK_4,                      3)
     80 	TAGKEYS(                        XK_5,                      4)
     81 	TAGKEYS(                        XK_6,                      5)
     82 	TAGKEYS(                        XK_7,                      6)
     83 	TAGKEYS(                        XK_8,                      7)
     84 	TAGKEYS(                        XK_9,                      8)
     85 };
     86 
     87 /* button definitions */
     88 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
     89 static Button buttons[] = {
     90 	/* click                event mask      button          function        argument */
     91 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
     92 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
     93 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
     94 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
     95 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
     96 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
     97 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
     98 	{ ClkTagBar,            0,              Button1,        view,           {0} },
     99 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    100 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    101 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    102 };