dwm

Suckless' dwm with my personal patches
git clone https://git.instinctive.eu/dwm.git
Log | Files | Refs | README | LICENSE

config.def.h (8210B)


      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 int showbar            = 1;        /* 0 means no bar */
      7 static const int topbar             = 1;        /* 0 means bottom bar */
      8 static const char *fonts[]          = { "monospace:size=10" };
      9 static const char dmenufont[]       = "monospace:size=10";
     10 static const char col_gray1[]       = "#222222";
     11 static const char col_gray2[]       = "#444444";
     12 static const char col_gray3[]       = "#bbbbbb";
     13 static const char col_gray4[]       = "#eeeeee";
     14 static const char col_cyan[]        = "#005577";
     15 static const char normmarkcolor[]   = "#775500";	/*border color for marked client*/
     16 static const char selmarkcolor[]    = "#775577";	/*border color for marked client on focus*/
     17 
     18 static const char *colors[][4]      = {
     19 	/*               fg         bg         border     mark   */
     20 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2, normmarkcolor },
     21 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan,  selmarkcolor  },
     22 };
     23 
     24 /* tagging */
     25 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     26 
     27 static const Rule rules[] = {
     28 	/* xprop(1):
     29 	 *	WM_CLASS(STRING) = instance, class
     30 	 *	WM_NAME(STRING) = title
     31 	 */
     32 	/* class      instance    title       tags mask     isfloating   monitor */
     33 	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
     34 	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     35 };
     36 
     37 /* layout(s) */
     38 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     39 static const int nmaster     = 1;    /* number of clients in master area */
     40 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     41 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     42 static const int pixelwidth  = 566;  /* Master width in pixel* layouts */
     43 static const int pixelheight = 846;  /* Master height in pixel* layouts */
     44 
     45 static const Layout layouts[] = {
     46 	/* symbol     arrange function */
     47 	{ "[]=",      tile },    /* first entry is default */
     48 	{ "><>",      NULL },    /* no layout function means floating behavior */
     49 	{ "[M]",      monocle },
     50 	{ "[D]",      deck },
     51 	{ "Pr",       pixelrow },
     52 	{ "Pc",       pixeldeckcol },
     53 };
     54 
     55 /* key definitions */
     56 #define MODKEY Mod1Mask
     57 #define TAGKEYS(KEY,TAG) \
     58 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     59 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     60 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     61 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     62 
     63 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     64 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     65 
     66 /* commands */
     67 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     68 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
     69 static const char *termcmd[]  = { "st", NULL };
     70 static const char scratchpadname[] = "scratchpad";
     71 static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
     72 
     73 #include "focusurgent.c"
     74 #include "movestack.c"
     75 static const Key keys[] = {
     76 	/* modifier                     key        function        argument */
     77 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     78 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
     79 	{ MODKEY,                       XK_grave,  togglescratch,  {.v = scratchpadcmd } },
     80 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     81 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     82 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     83 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     84 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     85 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     86 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     87 	{ MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } },
     88 	{ MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } },
     89 	{ MODKEY,                       XK_Return, zoom,           {0} },
     90 	{ MODKEY,                       XK_Tab,    view,           {0} },
     91 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
     92 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
     93 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
     94 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
     95 	{ MODKEY,                       XK_r,      setlayout,      {.v = &layouts[3]} },
     96 	{ MODKEY|ControlMask,           XK_p,      setlayout,      {.v = &layouts[4]} },
     97 	{ MODKEY|ControlMask|ShiftMask, XK_p,      setlayout,      {.v = &layouts[5]} },
     98 	{ MODKEY,                       XK_space,  setlayout,      {0} },
     99 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    100 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    101 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    102 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    103 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    104 	{ MODKEY|ControlMask,           XK_comma,  swapmon,        {.i = -1 } },
    105 	{ MODKEY|ControlMask,           XK_period, swapmon,        {.i = +1 } },
    106 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    107 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    108 	{ MODKEY|ControlMask|ShiftMask, XK_comma,  swapmonvisible, {.i = -1 } },
    109 	{ MODKEY|ControlMask|ShiftMask, XK_period, swapmonvisible, {.i = +1 } },
    110 	TAGKEYS(                        XK_1,                      0)
    111 	TAGKEYS(                        XK_2,                      1)
    112 	TAGKEYS(                        XK_3,                      2)
    113 	TAGKEYS(                        XK_4,                      3)
    114 	TAGKEYS(                        XK_5,                      4)
    115 	TAGKEYS(                        XK_6,                      5)
    116 	TAGKEYS(                        XK_7,                      6)
    117 	TAGKEYS(                        XK_8,                      7)
    118 	TAGKEYS(                        XK_9,                      8)
    119 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    120 	{ MODKEY|ControlMask|ShiftMask, XK_q,      quit,           {1} },
    121 	{ MODKEY,                       XK_u,      focusurgent,    {0} },
    122 	{ MODKEY,                       XK_semicolon, togglemark,   {0} },
    123 	{ MODKEY,                       XK_o,      swapfocus,      {0} },
    124 	{ MODKEY,                       XK_u,      swapclient,     {0} },
    125 };
    126 
    127 /* button definitions */
    128 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    129 static const Button buttons[] = {
    130 	/* click                event mask      button          function        argument */
    131 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    132 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    133 	{ ClkWinTitle,          0,              Button1,        focustitle,     {0} },
    134 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    135 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    136 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    137 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    138 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    139 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    140 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    141 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    142 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    143 };
    144