dwm

dynamic window manager - with my changes
git clone https://pi.duncano.de/git/dwm.git

config.def.h (8906B)


      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      = 10;       /* 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[]          = {
      9 	"-*-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*,"
     10 	/* "-misc-fixed-medium-r-normal-*-12-*-*-*-*-*-*-*," */
     11 	/* "-gnu-unifont-medium-r-normal-*-*-*-*-*-*-*-*-*," */
     12 };
     13 static const char dmenufont[]       = "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*";
     14 static const char normbordercolor[] = "#383838";
     15 static const char normbgcolor[]     = "#181818";
     16 static const char normfgcolor[]     = "#D8D8D8";
     17 static const char selbordercolor[]  = "#7CAFC2";
     18 static const char selbgcolor[]      = "#383838";
     19 static const char selfgcolor[]      = "#D8D8D8";
     20 static const char urgentcolor[]     = "#AB4642";
     21 static const char *colors[][3]      = {
     22 	/*               fg         bg         border   */
     23 	[SchemeNorm] = { normfgcolor, normbgcolor, selbgcolor },
     24 	[SchemeSel] =  { selfgcolor, selbgcolor, selbordercolor },
     25 	[SchemeUrg] =  { selfgcolor, urgentcolor, urgentcolor },
     26 };
     27 
     28 /* tagging */
     29 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     30 
     31 static const Rule rules[] = {
     32 	/* xprop(1):
     33 	 *	WM_CLASS(STRING) = instance, class
     34 	 *	WM_NAME(STRING) = title
     35 	 */
     36 	/* class      instance    title       tags mask     isfloating   monitor */
     37 	{ "st-256color", NULL,       NULL,       0,            0,       -1,    },
     38 	{ "Firefox",      NULL,       NULL,       1 << 6,       0,       -1,    },
     39 	{ "Chromium",     NULL,       NULL,       1 << 6,       0,       -1,    },
     40 	{ "Thunderbird",  NULL,       NULL,       1 << 5,       0,       -1,    },
     41 	{ "Spotify",      NULL,       NULL,       1 << 4,       0,       -1,    },
     42 	{ "Tomahawk",     NULL,       NULL,       1 << 4,       0,       -1,    },
     43 	{ "Vlc",          NULL,       NULL,       1 << 4,       0,       -1,    },
     44 	{ "mpv",          NULL,       NULL,       1 << 4,       0,       -1,    },
     45 	{ "VirtualBox",   NULL,       NULL,       1 << 7,       0,       -1,    },
     46 	{ "VBoxSDL",      NULL,       NULL,       1 << 7,       0,       -1,    },
     47 	{ "mixer",        NULL,       NULL,       0,            1,       -1,    },
     48 	{ "feh",          NULL,       NULL,       0,            1,       -1,    },
     49 	{ "Steam",        NULL,       NULL,       1 << 8,       1,       -1,    },
     50 	{ NULL,           NULL,       "Steam",    1 << 8,       1,       -1,    },
     51 	{ "dota2",        NULL,       NULL,       1 << 8,       1,       -1,    },
     52 };
     53 
     54 /* layout(s) */
     55 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     56 static const int nmaster     = 1;    /* number of clients in master area */
     57 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     58 static const int fresizehints = 0;   /* 1 means respect size hints in floated resizals */
     59 
     60 static const Layout layouts[] = {
     61 	/* symbol     arrange function */
     62 	{ "[]=",      tile },    /* first entry is default */
     63 	{ "><>",      NULL },    /* no layout function means floating behavior */
     64 	{ "[M]",      monocle },
     65 };
     66 
     67 /* key definitions */
     68 #define MODKEY Mod4Mask
     69 #define TAGKEYS(KEY,TAG) \
     70 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     71 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     72 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     73 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     74 
     75 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     76 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     77 
     78 /* commands */
     79 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     80 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
     81 static const char *termcmd[]  = { "st", "-e", "dvtm", NULL };
     82 
     83 static Key keys[] = {
     84 	/* modifier                     key        function        argument */
     85 	{ MODKEY|ControlMask,           XK_j,      movey,          {.i = +10 } },
     86 	{ MODKEY|ControlMask,           XK_k,      movey,          {.i = -10 } },
     87 	{ MODKEY|ControlMask|ShiftMask, XK_j,      movey,          {.i = +1 } },
     88 	{ MODKEY|ControlMask|ShiftMask, XK_k,      movey,          {.i = -1 } },
     89 	{ MODKEY|ControlMask,           XK_l,      movex,          {.i = +10 } },
     90 	{ MODKEY|ControlMask,           XK_h,      movex,          {.i = -10 } },
     91 	{ MODKEY|ControlMask|ShiftMask, XK_l,      movex,          {.i = +1 } },
     92 	{ MODKEY|ControlMask|ShiftMask, XK_h,      movex,          {.i = -1 } },
     93 	{ MODKEY|Mod1Mask,              XK_j,      resizeh,        {.i = +10 } },
     94 	{ MODKEY|Mod1Mask,              XK_k,      resizeh,        {.i = -10 } },
     95 	{ MODKEY|Mod1Mask|ShiftMask,    XK_j,      resizeh,        {.i = +1 } },
     96 	{ MODKEY|Mod1Mask|ShiftMask,    XK_k,      resizeh,        {.i = -1 } },
     97 	{ MODKEY|Mod1Mask,              XK_l,      resizew,        {.i = +10 } },
     98 	{ MODKEY|Mod1Mask,              XK_h,      resizew,        {.i = -10 } },
     99 	{ MODKEY|Mod1Mask|ShiftMask,    XK_l,      resizew,        {.i = +1 } },
    100 	{ MODKEY|Mod1Mask|ShiftMask,    XK_h,      resizew,        {.i = -1 } },
    101 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    102 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    103 	{ MODKEY,                       XK_b,      togglebar,      {0} },
    104 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    105 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    106 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
    107 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
    108 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.01} },
    109 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.01} },
    110 	{ MODKEY,                       XK_Return, zoom,           {0} },
    111 	{ MODKEY,                       XK_Tab,    view,           {0} },
    112 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    113 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    114 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    115 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    116 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    117 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    118 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    119 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    120 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    121 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    122 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    123 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    124 	TAGKEYS(                        XK_1,                      0)
    125 	TAGKEYS(                        XK_2,                      1)
    126 	TAGKEYS(                        XK_3,                      2)
    127 	TAGKEYS(                        XK_4,                      3)
    128 	TAGKEYS(                        XK_5,                      4)
    129 	TAGKEYS(                        XK_6,                      5)
    130 	TAGKEYS(                        XK_7,                      6)
    131 	TAGKEYS(                        XK_8,                      7)
    132 	TAGKEYS(                        XK_9,                      8)
    133 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    134 };
    135 
    136 /* button definitions */
    137 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    138 static Button buttons[] = {
    139 	/* click                event mask      button          function        argument */
    140 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    141 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    142 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    143 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    144 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    145 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    146 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    147 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    148 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    149 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    150 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    151 };