dotfiles

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

dwm-6.5 (9295B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 #define ICONSIZE 20   /* icon size in pixels */
      4 #define ICONSPACING 5 /* space (pixels) between icon and title */
      5 
      6 /* alt-tab configuration */
      7 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 `*/
      8 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 */
      9 static const unsigned int tabPosY 			= 1;	/* tab position on Y axis, 0 = bottom, 1 = center, 2 = top */
     10 static const unsigned int tabPosX 			= 1;	/* tab position on X axis, 0 = left, 1 = center, 2 = right */
     11 static const unsigned int maxWTab 			= 600;	/* tab menu width */
     12 static const unsigned int maxHTab 			= 200;	/* tab menu height */
     13 
     14 /* appearance */
     15 static const unsigned int borderpx  = 1;        /* border pixel of windows */
     16 static const unsigned int gappx     = 5;        /* gaps between windows */
     17 static const unsigned int snap      = 32;       /* snap pixel */
     18 static const int showbar            = 1;        /* 0 means no bar */
     19 static const int topbar             = 1;        /* 0 means bottom bar */
     20 static const char *fonts[]          = { "monospace:size=12", "fontawesome:size=12" };
     21 static const char dmenufont[]       = "monospace:size=12";
     22 static const char col_gray1[]       = "#222222";
     23 static const char col_gray2[]       = "#444444";
     24 static const char col_gray3[]       = "#bbbbbb";
     25 static const char col_gray4[]       = "#eeeeee";
     26 static const char col_cyan[]        = "#ce4404";
     27 static const char *colors[][3]      = {
     28 	/*               fg         bg         border   */
     29 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     30 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
     31 };
     32 
     33 /* tagging */
     34 static const char *tags[] = { "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉" };
     35 
     36 static const Rule rules[] = {
     37 	/* xprop(1):
     38 	 *	WM_CLASS(STRING) = instance, class
     39 	 *	WM_NAME(STRING) = title
     40 	 */
     41 	/* class      instance    title       tags mask     isfloating   monitor */
     42 	{ "st",       NULL,       "MP3",      1 << 5,       0,           -1 },
     43 	{ "mpv",      NULL,       "MPV",      1 << 6,       0,           -1 },
     44 };
     45 
     46 /* layout(s) */
     47 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     48 static const int nmaster     = 1;    /* number of clients in master area */
     49 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     50 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     51 
     52 static const Layout layouts[] = {
     53 	/* symbol     arrange function */
     54 	{ "[M]",      monocle },
     55 	{ "><>",      NULL },    /* no layout function means floating behavior */
     56 	{ "[]=",      tile },    /* first entry is default */
     57 };
     58 
     59 /* key definitions */
     60 #define MODKEY Mod4Mask
     61 #define TAGKEYS(KEY,TAG) \
     62 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     63 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     64 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     65 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     66 
     67 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     68 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     69 
     70 /* commands */
     71 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     72 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, "-hp", "qutebrowser,discord,steam", NULL };
     73 static const char *termcmd[]  = { "st", NULL };
     74 static const char *sc[] = { "sc", NULL };
     75 static const char *vimator[] = { "vimator", NULL };
     76 static const char *altl[] = { "altl", NULL };
     77 static const char *musplus[] = { "musplus", NULL };
     78 static const char *musminus[] = { "musminus", NULL };
     79 static const char *altspace[] = { "altspace", NULL };
     80 static const char *altnine[] = { "altnine", NULL };
     81 static const char *altzero[] = { "altzero", NULL };
     82 static const char *altq[] = { "altq", NULL };
     83 static const char *altb[] = { "altb", NULL };
     84 static const char *alts[] = { "alts", NULL };
     85 static const char *alto[] = { "alto", NULL };
     86 
     87 
     88 static const Key keys[] = {
     89 	/* modifier                     key        function        argument */
     90 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     91 	{ MODKEY,                       XK_space,  spawn,          {.v = termcmd } },
     92 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     93 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     94 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     95 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     96 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     97 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     98 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     99 	{ MODKEY,                       XK_Return, zoom,           {0} },
    100 	{ MODKEY,                       XK_q,      view,           {0} },
    101 	{ MODKEY,                       XK_c,      killclient,     {0} },
    102 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[0]} },
    103 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    104 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[2]} },
    105 	{ MODKEY|ShiftMask,             XK_Return, setlayout,      {0} },
    106 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    107 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    108 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    109 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    110 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    111 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    112 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    113 	{ MODKEY,                       XK_s,      spawn,          {.v = sc } },
    114 	{ MODKEY,                       XK_a,      spawn,          {.v = vimator } },
    115 	{ Mod1Mask,                     XK_l,      spawn,          {.v = altl } },
    116 	{ Mod1Mask,                     XK_period, spawn,          {.v = musplus } },
    117 	{ Mod1Mask,                     XK_comma,  spawn,          {.v = musminus } },
    118 	{ Mod1Mask,                     XK_space,  spawn,          {.v = altspace } },
    119 	{ Mod1Mask,                     XK_9,      spawn,          {.v = altnine } },
    120 	{ Mod1Mask,                     XK_0,      spawn,          {.v = altzero } },
    121 	{ Mod1Mask,                     XK_q,      spawn,          {.v = altq } },
    122 	{ Mod1Mask|ShiftMask,           XK_period, spawn,          {.v = altb } },
    123 	{ Mod1Mask|ShiftMask,           XK_comma,  spawn,          {.v = alts } },
    124 	{ Mod1Mask,                     XK_o,      spawn,          {.v = alto } },
    125 	{ Mod1Mask,             		XK_Tab,    altTabStart,	   {0} },
    126 	{ MODKEY,                       XK_Right,  viewnext,       {0} },
    127 	{ MODKEY,                       XK_Left,   viewprev,       {0} },
    128 	{ MODKEY|ShiftMask,             XK_Right,  tagtonext,      {0} },
    129 	{ MODKEY|ShiftMask,             XK_Left,   tagtoprev,      {0} },
    130 	TAGKEYS(                        XK_1,                      0)
    131 	TAGKEYS(                        XK_2,                      1)
    132 	TAGKEYS(                        XK_3,                      2)
    133 	TAGKEYS(                        XK_4,                      3)
    134 	TAGKEYS(                        XK_5,                      4)
    135 	TAGKEYS(                        XK_6,                      5)
    136 	TAGKEYS(                        XK_7,                      6)
    137 	TAGKEYS(                        XK_8,                      7)
    138 	TAGKEYS(                        XK_9,                      8)
    139 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    140 };
    141 
    142 /* button definitions */
    143 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    144 static const Button buttons[] = {
    145 	/* click                event mask      button          function        argument */
    146 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    147 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    148 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    149 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    150 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    151 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    152 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    153 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    154 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    155 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    156 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    157 };
    158