dotfiles

My collection of dotfiles
git clone git://git.stellar-nexus.ru/dotfiles
Log | Files | Refs

dwm-6.4 (7113B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* alt-tab configuration */
      4 static const unsigned int tabModKey 		= 0x40;	/* if this key is hold the alt-tab functionality stays acitve. This key must be the same as key that is used to active functin altTabStart `*/
      5 static const unsigned int tabCycleKey 		= 0x17;	/* if this key is hit the alt-tab program moves one position forward in clients stack. This key must be the same as key that is used to active functin altTabStart */
      6 static const unsigned int tabPosY 			= 1;	/* tab position on Y axis, 0 = bottom, 1 = center, 2 = top */
      7 static const unsigned int tabPosX 			= 1;	/* tab position on X axis, 0 = left, 1 = center, 2 = right */
      8 static const unsigned int maxWTab 			= 600;	/* tab menu width */
      9 static const unsigned int maxHTab 			= 200;	/* tab menu height */
     10 
     11 /* appearance */
     12 static const unsigned int borderpx  = 0;        /* border pixel of windows */
     13 static const unsigned int snap      = 32;       /* snap pixel */
     14 static const int showbar            = 0;        /* 0 means no bar */
     15 static const int topbar             = 1;        /* 0 means bottom bar */
     16 static const char *fonts[]          = { "monospace:size=10" };
     17 static const char dmenufont[]       = "monospace:size=10";
     18 static const char col_gray1[]       = "#222222";
     19 static const char col_gray2[]       = "#444444";
     20 static const char col_gray3[]       = "#bbbbbb";
     21 static const char col_gray4[]       = "#eeeeee";
     22 static const char col_cyan[]        = "#ce4404";
     23 static const char *colors[][3]      = {
     24 	/*               fg         bg         border   */
     25 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     26 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
     27 };
     28 
     29 /* tagging */
     30 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     31 
     32 static const Rule rules[] = {
     33 	/* xprop(1):
     34 	 *	WM_CLASS(STRING) = instance, class
     35 	 *	WM_NAME(STRING) = title
     36 	 */
     37 	/* class      instance    title       tags mask     isfloating   monitor */
     38 	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
     39 	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     40 };
     41 
     42 /* layout(s) */
     43 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     44 static const int nmaster     = 1;    /* number of clients in master area */
     45 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     46 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     47 
     48 static const Layout layouts[] = {
     49 	/* symbol     arrange function */
     50 	{ "[M]",      monocle },
     51 	{ "><>",      NULL },    /* no layout function means floating behavior */
     52 	{ "[]=",      tile },    /* first entry is default */
     53 };
     54 
     55 /* key definitions */
     56 #define MODKEY Mod4Mask
     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 const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
     68 static const char *termcmd[]  = { "st", NULL };
     69 
     70 static const Key keys[] = {
     71 	/* modifier                     key        function        argument */
     72 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     73 	{ MODKEY,                       XK_space,  spawn,          {.v = termcmd } },
     74 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     75 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     76 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     77 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     78 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     79 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     80 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     81 	{ MODKEY,                       XK_Return, zoom,           {0} },
     82 	{ MODKEY,                       XK_q,	   view,           {0} },
     83 	{ MODKEY,                       XK_c,      killclient,     {0} },
     84 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[0]} },
     85 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
     86 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[2]} },
     87 	{ MODKEY|ShiftMask,             XK_Return, setlayout,      {0} },
     88 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
     89 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
     90 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
     91 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
     92 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
     93 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
     94 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
     95 	{ Mod1Mask,             		XK_Tab,    altTabStart,	   {0} },
     96 	TAGKEYS(                        XK_1,                      0)
     97 	TAGKEYS(                        XK_2,                      1)
     98 	TAGKEYS(                        XK_3,                      2)
     99 	TAGKEYS(                        XK_4,                      3)
    100 	TAGKEYS(                        XK_5,                      4)
    101 	TAGKEYS(                        XK_6,                      5)
    102 	TAGKEYS(                        XK_7,                      6)
    103 	TAGKEYS(                        XK_8,                      7)
    104 	TAGKEYS(                        XK_9,                      8)
    105 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    106 };
    107 
    108 /* button definitions */
    109 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    110 static const Button buttons[] = {
    111 	/* click                event mask      button          function        argument */
    112 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    113 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    114 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    115 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    116 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    117 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    118 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    119 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    120 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    121 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    122 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    123 };
    124