dwm

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

config.def.h (10605B)


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