dwm

my customized branch of dwm
git clone git://git.jakekoroman.com/dwm
Log | Files | Refs | README | LICENSE

config.def.h (7623B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include "movestack.c"
      3 
      4 /* appearance */
      5 static const unsigned int borderpx  = 1;        /* border pixel of windows */
      6 static const unsigned int snap      = 32;       /* snap pixel */
      7 static const int swallowfloating    = 0;        /* 1 means swallow floating windows by default */
      8 static const int showbar            = 1;        /* 0 means no bar */
      9 static const int topbar             = 1;        /* 0 means bottom bar */
     10 static const char *fonts[]          = { "monospace:size=10" };
     11 static const char dmenufont[]       = "monospace:size=10";
     12 static const char col_gray1[]       = "#222222";
     13 static const char col_gray2[]       = "#444444";
     14 static const char col_gray3[]       = "#bbbbbb";
     15 static const char col_gray4[]       = "#eeeeee";
     16 static const char col_cyan[]        = "#005577";
     17 static const char *colors[][3]      = {
     18 	/*                      fg         bg         border   */
     19 	[SchemeNorm]        = { col_gray3, col_gray1, col_gray2 },
     20 	[SchemeSel]         = { col_gray4, col_cyan,  col_cyan  },
     21 	[SchemeTabActive]   = { col_gray2, col_gray3, col_gray2 },
     22 	[SchemeTabInactive] = { col_gray1, col_gray3, col_gray1 }
     23 };
     24 
     25 /* tagging */
     26 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     27 
     28 static const Rule rules[] = {
     29 	/* xprop(1):
     30 	 *	WM_CLASS(STRING) = instance, class
     31 	 *	WM_NAME(STRING) = title
     32 	 */
     33 	/* class     instance  title           tags mask  isfloating  isterminal   swallow  monitor */
     34 	{ "Gimp",    NULL,     NULL,           0,         1,          0,           0,        -1 },
     35 	{ "st",      NULL,     NULL,           0,         0,          1,           0,        -1 },
     36 	{ "mpv",     NULL,     NULL,           0,         0,          0,           1,        -1 },
     37 };
     38 
     39 /* layout(s) */
     40 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     41 static const int nmaster     = 1;    /* number of clients in master area */
     42 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     43 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     44 
     45 /* Bartabgroups properties */
     46 #define BARTAB_BORDERS 1       // 0 = off, 1 = on
     47 #define BARTAB_BOTTOMBORDER 1  // 0 = off, 1 = on
     48 #define BARTAB_TAGSINDICATOR 1 // 0 = off, 1 = on if >1 client/view tag, 2 = always on
     49 #define BARTAB_TAGSPX 5        // # pixels for tag grid boxes
     50 #define BARTAB_TAGSROWS 3      // # rows in tag grid (9 tags, e.g. 3x3)
     51 static void (*bartabmonfns[])(Monitor *) = { monocle /* , customlayoutfn */ };
     52 static void (*bartabfloatfns[])(Monitor *) = { NULL /* , customlayoutfn */ };
     53 
     54 static const Layout layouts[] = {
     55 	/* symbol     arrange function */
     56 	{ "[]=",      tile },    /* first entry is default */
     57 	{ "><>",      NULL },    /* no layout function means floating behavior */
     58 	{ "[M]",      monocle },
     59 	{ "[D]",      deck },
     60 };
     61 
     62 /* key definitions */
     63 #define MODKEY Mod1Mask
     64 #define TAGKEYS(KEY,TAG) \
     65 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     66 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     67 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     68 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     69 
     70 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     71 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     72 
     73 /* commands */
     74 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     75 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
     76 static const char *termcmd[]  = { "st", NULL };
     77 
     78 static const Key keys[] = {
     79 	/* modifier                     key        function        argument */
     80 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     81 	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
     82 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     83 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     84 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     85 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     86 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     87 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     88 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     89 	{ MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } },
     90 	{ MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } },
     91 	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
     92 	{ MODKEY,                       XK_Tab,    view,           {0} },
     93 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
     94 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
     95 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
     96 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
     97 	{ MODKEY,                       XK_y,      setlayout,      {.v = &layouts[3]} },
     98 	{ MODKEY,                       XK_space,  setlayout,      {0} },
     99 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    100 	{ MODKEY|ShiftMask,             XK_f,      togglefullscr,  {0} },
    101 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    102 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    103 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    104 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    105 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    106 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    107 	TAGKEYS(                        XK_1,                      0)
    108 	TAGKEYS(                        XK_2,                      1)
    109 	TAGKEYS(                        XK_3,                      2)
    110 	TAGKEYS(                        XK_4,                      3)
    111 	TAGKEYS(                        XK_5,                      4)
    112 	TAGKEYS(                        XK_6,                      5)
    113 	TAGKEYS(                        XK_7,                      6)
    114 	TAGKEYS(                        XK_8,                      7)
    115 	TAGKEYS(                        XK_9,                      8)
    116 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    117 };
    118 
    119 /* button definitions */
    120 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    121 static const Button buttons[] = {
    122 	/* click                event mask      button          function        argument */
    123 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    124 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    125 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    126 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    127 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    128 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    129 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    130 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    131 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    132 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    133 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    134 };
    135