dwm

custom dwm build (upstream ~> git://dwm.suckless.org/dwm)
Log | Files | Refs | README | LICENSE

config.def.h (9591B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 0;        /* border pixel of windows */
      5 static const unsigned int snap      = 32;       /* snap pixel */
      6 static const unsigned int gappih    = 15;       /* horiz inner gap between windows */
      7 static const unsigned int gappiv    = 15;       /* vert inner gap between windows */
      8 static const unsigned int gappoh    = 15;       /* horiz outer gap between windows and screen edge */
      9 static const unsigned int gappov    = 15;       /* vert outer gap between windows and screen edge */
     10 static const int smartgaps          = 1;        /* 1 means no outer gap when there is only one window */
     11 static const int showbar            = 1;        /* 0 means no bar */
     12 static const int topbar             = 0;        /* 0 means bottom bar */
     13 static const int swallowfloating    = 0;        /* 1 means swallow floating windows by default */
     14 static const char *fonts[]          = { "monospace:size=11" };
     15 static const char dmenufont[]       = "monospace:size=11";
     16 static const char dmenuprompt[]       = "~>";
     17 static const char col_gray1[]       = "#222222";
     18 static const char col_gray2[]       = "#444444";
     19 static const char col_gray3[]       = "#bbbbbb";
     20 static const char col_gray4[]       = "#eeeeee";
     21 //static const char col_cyan[]        = "#1E2541";
     22 static const char col_cyan[]        = "#005577";
     23 static const unsigned int baralpha = 0xd0;
     24 static const unsigned int borderalpha = OPAQUE;
     25 static const char *colors[][3]      = {
     26 	/*               fg         bg         border   */
     27 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     28 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
     29 };
     30 static const unsigned int alphas[][3]      = {
     31 	/*               fg      bg        border     */
     32 	[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
     33 	[SchemeSel]  = { OPAQUE, baralpha, borderalpha },
     34 };
     35 
     36 /* tagging */
     37 static const char *tags[] = { "一", "二", "三", "四", "五", "六", "七", "八", "九" };
     38 static const char *tagsalt[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     39 
     40 static const Rule rules[] = {
     41 	/* xprop(1):
     42 	 *	WM_CLASS(STRING) = instance, class
     43 	 *	WM_NAME(STRING) = title
     44 	 */
     45 	/* class     instance  title           tags mask  isfloating  isterminal  noswallow  monitor */
     46 	{ "St",      NULL,     NULL,           0,         0,          1,           0,        -1 },
     47 	{ NULL,      NULL,     "Event Tester", 0,         0,          0,           1,        -1 }, /* xev */
     48 };
     49 
     50 /* layout(s) */
     51 static const float mfact     = 0.50; /* factor of master area size [0.05..0.95] */
     52 static const int nmaster     = 1;    /* number of clients in master area */
     53 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     54 static const int attachbelow = 1;    /* 1 means attach after the currently active window */
     55 
     56 #include "fibonacci.c"
     57 static const Layout layouts[] = {
     58 	/* symbol     arrange function */
     59  	{ "[@]",      spiral },
     60 	{ "[=]",      tile },    /* first entry is default */
     61 	{ "><>",      NULL },    /* no layout function means floating behavior */
     62 	{ "[M]",      monocle },
     63  	{ "[\]",      dwindle },
     64 };
     65 
     66 /* key definitions */
     67 #define MODKEY Mod4Mask
     68 #define TAGKEYS(KEY,TAG) 
     69 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, 
     70 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, 
     71 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, 
     72 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     73 
     74 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     75 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     76 
     77 /* commands */
     78 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     79 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, "-p", dmenuprompt, NULL };
     80 static const char *termcmd[]  = { "st", NULL };
     81 
     82 static Key keys[] = {
     83 	/* modifier                     key        function        argument */
     84 	{ MODKEY,                       XK_a,      spawn,          SHCMD("acento.sh") },
     85 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     86 	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
     87 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     88 	{ MODKEY|ShiftMask,             XK_j,      rotatestack,    {.i = +1 } },
     89 	{ MODKEY|ShiftMask,             XK_k,      rotatestack,    {.i = -1 } },
     90 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     91 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     92 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     93 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     94 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     95 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     96 /*	{ MODKEY|Mod4Mask,              XK_h,      incrgaps,       {.i = +1 } }, */
     97 /*	{ MODKEY|Mod4Mask,              XK_l,      incrgaps,       {.i = -1 } }, */
     98 /*	{ MODKEY|Mod4Mask|ShiftMask,    XK_h,      incrogaps,      {.i = +1 } }, */
     99 /*	{ MODKEY|Mod4Mask|ShiftMask,    XK_l,      incrogaps,      {.i = -1 } }, */
    100 /*	{ MODKEY|Mod4Mask|ControlMask,  XK_h,      incrigaps,      {.i = +1 } }, */
    101 /*	{ MODKEY|Mod4Mask|ControlMask,  XK_l,      incrigaps,      {.i = -1 } }, */
    102 /*	{ MODKEY|Mod4Mask,              XK_0,      togglegaps,     {0} }, */
    103 /*	{ MODKEY|Mod4Mask|ShiftMask,    XK_0,      defaultgaps,    {0} }, */
    104 /*	{ MODKEY,                       XK_y,      incrihgaps,     {.i = +1 } }, */
    105 /*	{ MODKEY,                       XK_o,      incrihgaps,     {.i = -1 } }, */
    106 /*	{ MODKEY|ControlMask,           XK_y,      incrivgaps,     {.i = +1 } }, */
    107 /*	{ MODKEY|ControlMask,           XK_o,      incrivgaps,     {.i = -1 } }, */
    108 /*	{ MODKEY|Mod4Mask,              XK_y,      incrohgaps,     {.i = +1 } }, */
    109 /*	{ MODKEY|Mod4Mask,              XK_o,      incrohgaps,     {.i = -1 } }, */
    110 /*	{ MODKEY|ShiftMask,             XK_y,      incrovgaps,     {.i = +1 } }, */
    111 /*	{ MODKEY|ShiftMask,             XK_o,      incrovgaps,     {.i = -1 } }, */
    112 	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
    113 	{ MODKEY,                       XK_Tab,    view,           {0} },
    114 	{ MODKEY|ShiftMask,             XK_q,      killclient,     {0} },
    115 	{ MODKEY,                       XK_r,      setlayout,      {.v = &layouts[0]} },
    116 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[1]} },
    117 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[2]} },
    118 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[3]} },
    119 	{ MODKEY|ShiftMask,             XK_r,      setlayout,      {.v = &layouts[4]} },
    120 	{ MODKEY,                       XK_y,      spawn,          SHCMD("wallpapers.sh ~/documents/wallpapers &") },
    121 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    122 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    123 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    124 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    125 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    126 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    127 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    128 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    129  	{ MODKEY,                       XK_n,      togglealttag,   {0} },
    130 	{ MODKEY|ShiftMask,             XK_l,      spawn,          SHCMD("lock.sh &") },
    131 	{ MODKEY,                       XK_Print,  spawn,          SHCMD("scrot -u") },
    132 	TAGKEYS(                        XK_1,                      0)
    133 	TAGKEYS(                        XK_2,                      1)
    134 	TAGKEYS(                        XK_3,                      2)
    135 	TAGKEYS(                        XK_4,                      3)
    136 	TAGKEYS(                        XK_5,                      4)
    137 	TAGKEYS(                        XK_6,                      5)
    138 	TAGKEYS(                        XK_7,                      6)
    139 	TAGKEYS(                        XK_8,                      7)
    140 	TAGKEYS(                        XK_9,                      8)
    141 	{ MODKEY|ShiftMask,             XK_e,      quit,           {0} },
    142 };
    143 
    144 /* button definitions */
    145 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    146 static Button buttons[] = {
    147 	/* click                event mask      button          function        argument */
    148 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    149 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    150 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    151 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    152 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    153 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    154 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    155 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    156 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    157 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    158 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    159 };