dwm

my customized dwm build
git clone git://git.hanetzok.net/dwm
Log | Files | Refs | README | LICENSE

config.def.h (10011B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 3;        /* border pixel of windows */
      5 static const unsigned int snap      = 32;       /* snap pixel */
      6 static const unsigned int gappih    = 10;       /* 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    = 10;       /* vert outer gap between windows and screen edge */
     10 static const 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 unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
     13 static const unsigned int systrayonleft = 0;    /* 0: systray in the right corner, >0: systray on left of status text */
     14 static const unsigned int systrayspacing = 2;   /* systray spacing */
     15 static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
     16 static const int showsystray        = 1;        /* 0 means no systray */
     17 static const int showbar            = 1;        /* 0 means no bar */
     18 static const int topbar             = 1;        /* 0 means bottom bar */
     19 static const char *fonts[]          = { "monospace:size=10" };
     20 static const char dmenufont[]       = "monospace:size=10";
     21 static char normbgcolor[]           = "#222222";
     22 static char normbordercolor[]       = "#444444";
     23 static char normfgcolor[]           = "#bbbbbb";
     24 static char selfgcolor[]            = "#eeeeee";
     25 static char selbordercolor[]        = "#005577";
     26 static char selbgcolor[]            = "#005577";
     27 static char *colors[][3] = {
     28        /*               fg           bg           border   */
     29        [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
     30        [SchemeSel]  = { selfgcolor,  selbgcolor,  selbordercolor  },
     31 };
     32 
     33 typedef struct {
     34 	const char *name;
     35 	const void *cmd;
     36 } Sp;
     37 const char *spcmd1[] = {"st", "-n", "spmixer", "-g", "120x34", "-e", "pulsemixer", NULL };
     38 const char *spcmd2[] = {"st", "-n", "spfm", "-g", "144x41", "-e", "ranger", NULL };
     39 const char *spcmd3[] = {"keepassxc", NULL };
     40 static Sp scratchpads[] = {
     41 	/* name          cmd  */
     42 	{"spmixer",      spcmd1},
     43 	{"spranger",    spcmd2},
     44 	{"keepassxc",   spcmd3},
     45 };
     46 
     47 /* tagging */
     48 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     49 static const Rule rules[] = {
     50 	/* xprop(1):
     51 	 *	WM_CLASS(STRING) = instance, class
     52 	 *	WM_NAME(STRING) = title
     53 	 */
     54 	/* class     instance      title           tags mask  isfloating  isterminal  noswallow  monitor */
     55 	{ "Gimp",    NULL,         NULL,           0,         1,          0,           0,        -1 },
     56 	{ "Firefox", NULL,         NULL,           1 << 8,    0,          0,          -1,        -1 },
     57 	{ "St",      NULL,         NULL,           0,         0,          1,           0,        -1 },
     58 	{ NULL,      NULL,         "Event Tester", 0,         0,          0,           1,        -1 }, /* xev */
     59 	{ NULL,      "spmixer",	   NULL,           SPTAG(0),  1,          1,           1,        -1 },
     60 	{ NULL,      "spfm",	   NULL,           SPTAG(1),  1,          1,           1,        -1 },
     61 	{ NULL,      "keepassxc",  NULL,           SPTAG(2),  0,          0,           1,        -1 },
     62 };
     63 
     64 /* layout(s) */
     65 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     66 static const int nmaster     = 1;    /* number of clients in master area */
     67 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     68 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     69 static const int refreshrate = 120;  /* refresh rate (per second) for client move/resize */
     70 
     71 static const Layout layouts[] = {
     72 	/* symbol     arrange function */
     73 	{ "[]=",      tile },    /* first entry is default */
     74 	{ "><>",      NULL },    /* no layout function means floating behavior */
     75 	{ "[M]",      monocle },
     76 };
     77 
     78 /* key definitions */
     79 #define MODKEY Mod4Mask
     80 #define TAGKEYS(KEY,TAG) \
     81 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     82 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     83 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     84 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     85 
     86 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     87 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     88 
     89 /* commands */
     90 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     91 static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
     92 static const char *termcmd[]  = { "st", NULL };
     93 
     94 static Key keys[] = {
     95 	/* modifier                     key        function        argument */
     96 	{ MODKEY,                       XK_d,      spawn,          {.v = dmenucmd } },
     97 	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
     98 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     99 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    100 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    101 	{ MODKEY|ControlMask,           XK_k,      incnmaster,     {.i = +1 } },
    102 	{ MODKEY|ControlMask,           XK_j,      incnmaster,     {.i = -1 } },
    103 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    104 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    105 	{ MODKEY,                       XK_space,  zoom,           {0} },
    106 	{ MODKEY,                       XK_Tab,    view,           {0} },
    107 	{ MODKEY,                       XK_q,      killclient,     {0} },
    108 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    109 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    110 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    111 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    112 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    113 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    114 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    115 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    116 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    117 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    118 	{ MODKEY,            		XK_p,  	   togglescratch,  {.ui = 0 } },
    119 	{ MODKEY,            		XK_u,	   togglescratch,  {.ui = 1 } },
    120 	{ MODKEY,            		XK_x,	   togglescratch,  {.ui = 2 } },
    121 	{ MODKEY,                       XK_F5,     xrdb,           {.v = NULL } },
    122 	{ MODKEY|ShiftMask,             XK_h,      incrgaps,       {.i = +1 } },
    123 	{ MODKEY|ShiftMask,             XK_l,      incrgaps,       {.i = -1 } },
    124 	{ MODKEY|Mod4Mask|ShiftMask,    XK_h,      incrogaps,      {.i = +1 } },
    125 	{ MODKEY|Mod4Mask|ShiftMask,    XK_l,      incrogaps,      {.i = -1 } },
    126 	{ MODKEY|Mod4Mask|ControlMask,  XK_h,      incrigaps,      {.i = +1 } },
    127 	{ MODKEY|Mod4Mask|ControlMask,  XK_l,      incrigaps,      {.i = -1 } },
    128 	{ MODKEY,                       XK_g,      togglegaps,     {0} },
    129 	{ MODKEY|ShiftMask,             XK_g,      defaultgaps,    {0} },
    130 	{ MODKEY,                       XK_y,      incrihgaps,     {.i = +1 } },
    131 	{ MODKEY,                       XK_o,      incrihgaps,     {.i = -1 } },
    132 	{ MODKEY|ControlMask,           XK_y,      incrivgaps,     {.i = +1 } },
    133 	{ MODKEY|ControlMask,           XK_o,      incrivgaps,     {.i = -1 } },
    134 	{ MODKEY|Mod4Mask,              XK_y,      incrohgaps,     {.i = +1 } },
    135 	{ MODKEY|Mod4Mask,              XK_o,      incrohgaps,     {.i = -1 } },
    136 	{ MODKEY|ShiftMask,             XK_y,      incrovgaps,     {.i = +1 } },
    137 	{ MODKEY|ShiftMask,             XK_o,      incrovgaps,     {.i = -1 } },
    138 	TAGKEYS(                        XK_1,                      0)
    139 	TAGKEYS(                        XK_2,                      1)
    140 	TAGKEYS(                        XK_3,                      2)
    141 	TAGKEYS(                        XK_4,                      3)
    142 	TAGKEYS(                        XK_5,                      4)
    143 	TAGKEYS(                        XK_6,                      5)
    144 	TAGKEYS(                        XK_7,                      6)
    145 	TAGKEYS(                        XK_8,                      7)
    146 	TAGKEYS(                        XK_9,                      8)
    147 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    148 };
    149 
    150 /* button definitions */
    151 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    152 static const Button buttons[] = {
    153 	/* click                event mask      button          function        argument */
    154 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    155 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    156 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    157 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    158 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    159 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    160 	{ ClkClientWin,         MODKEY,         Button1,        resizemouse,    {0} },
    161 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    162 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    163 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    164 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    165 };
    166