dwm

git clone git://mattcarlson.org/repos/dwm.git
Log | Files | Refs

config.h (12610B)


      1 // dwm
      2 
      3 static unsigned int borderpx = 1;
      4 static unsigned int snap     = 32;
      5 
      6 // swallow
      7 static int swallowfloating = 0;
      8 
      9 // gaps
     10 static unsigned int gappih = 20;
     11 static unsigned int gappiv = 10;
     12 static unsigned int gappoh = 10;
     13 static unsigned int gappov = 30;
     14 static int smartgaps       = 0;
     15 
     16 // bar
     17 static int showbar = 1;
     18 static int topbar  = 1;
     19 
     20 // barpadding
     21 static int vertpad = 10;
     22 static int sidepad = 10;
     23 
     24 // fonts
     25 static char font[]         = "monospace:size=10";
     26 static const char *fonts[] = { font, "Noto Color Emoji:style=Regular:size=16" };
     27 
     28 // colors
     29 static char normbgcolor[]     = "#222222";
     30 static char normbordercolor[] = "#444444";
     31 static char normfgcolor[]     = "#bbbbbb";
     32 static char selfgcolor[]      = "#eeeeee";
     33 static char selbordercolor[]  = "#005577";
     34 static char selbgcolor[]      = "#005577";
     35 
     36 // alpha
     37 static const unsigned int baralpha    = OPAQUE;
     38 static const unsigned int borderalpha = OPAQUE;
     39 
     40 // color array
     41 static char *colors[][3] = {
     42        //               fg           bg           border
     43        [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
     44        [SchemeSel]  = { selfgcolor,  selbgcolor,  selbordercolor  },
     45 };
     46 
     47 // alpha array
     48 static const unsigned int alphas[][3] = {
     49     //               fg      bg        border
     50 	[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
     51 	[SchemeSel]  = { OPAQUE, baralpha, borderalpha },
     52 };
     53 
     54 // autostart
     55 static const char *const autostart[] = {
     56     // start status bar
     57 	"sh", "-c", "${BAR}", NULL,
     58 	NULL
     59 };
     60 
     61 // tags
     62 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     63 
     64 // underline
     65 static unsigned int ulinepad	 = 5;
     66 static unsigned int ulinestroke	 = 2;
     67 static unsigned int ulinevoffset = 0;
     68 static int ulineall 		     = 0;
     69 
     70 // rules
     71 static const Rule rules[] = {
     72    // class                 instance title tags mask isfloating isterminal noswallow monitor
     73     { "fff",                NULL,    NULL, 0,        0,         1,         0,        -1 },
     74     { "st",                 NULL,    NULL, 0,        0,         1,         0,        -1 },
     75     { "vim",                NULL,    NULL, 0,        0,         0,         1,        -1 },
     76     { "Qemu-system-x86_64", NULL,    NULL, 0,        0,         0,         0,        -1 },
     77     { "newsboat",           NULL,    NULL, 0,        0,         1,         0,        -1 },
     78 };
     79 
     80 // sizes
     81 static float mfact     = 0.55;
     82 static int nmaster     = 1;
     83 static int resizehints = 1;
     84 
     85 // vanitygaps layouts
     86 #define FORCE_VSPLIT 1
     87 #include "vanitygaps.c"
     88 static const Layout layouts[] = {
     89    // symbol  arrange function
     90 	{ "[]=",  tile                   },
     91 	{ "[M]",  monocle                },
     92 	{ "[@]",  spiral                 },
     93 	{ "[\\]", dwindle                },
     94 	{ "H[]",  deck                   },
     95 	{ "TTT",  bstack                 },
     96 	{ "===",  bstackhoriz            },
     97 	{ "HHH",  grid                   },
     98 	{ "###",  nrowgrid               },
     99 	{ "---",  horizgrid              },
    100 	{ ":::",  gaplessgrid            },
    101 	{ "|M|",  centeredmaster         },
    102 	{ ">M>",  centeredfloatingmaster },
    103 	{ "><>",  NULL                   },
    104 	{ NULL,   NULL                   },
    105 };
    106 
    107 // modifier key
    108 #define MODKEY Mod4Mask
    109 
    110 // tag keys
    111 #define TAGKEYS(KEY,TAG) \
    112 	{ MODKEY,                       KEY, view,       {.ui = 1 << TAG} }, \
    113 	{ MODKEY|ControlMask,           KEY, toggleview, {.ui = 1 << TAG} }, \
    114 	{ MODKEY|ShiftMask,             KEY, tag,        {.ui = 1 << TAG} }, \
    115 	{ MODKEY|ControlMask|ShiftMask, KEY, toggletag,  {.ui = 1 << TAG} },
    116 
    117 // shcmd
    118 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    119 
    120 // status bar
    121 #define STATUSBAR "dwmblocks"
    122 
    123 // termcmd
    124 #define TERM "st"
    125 static const char *termcmd[]  = { TERM, NULL };
    126 
    127 // xresources
    128 ResourcePref resources[] = {
    129 		{ "font",            STRING,  &font            },
    130 		{ "normbgcolor",     STRING,  &normbgcolor     },
    131 		{ "normbordercolor", STRING,  &normbordercolor },
    132 		{ "normfgcolor",     STRING,  &normfgcolor     },
    133 		{ "selbgcolor",      STRING,  &selbgcolor      },
    134 		{ "selbordercolor",  STRING,  &selbordercolor  },
    135 		{ "selfgcolor",      STRING,  &selfgcolor      },
    136 		{ "borderpx",        INTEGER, &borderpx        },
    137 		{ "snap",          	 INTEGER, &snap            },
    138 		{ "showbar",         INTEGER, &showbar         },
    139 		{ "topbar",          INTEGER, &topbar          },
    140 		{ "nmaster",         INTEGER, &nmaster         },
    141 		{ "resizehints",     INTEGER, &resizehints     },
    142 		{ "mfact",      	 FLOAT,   &mfact           },
    143         { "swallowfloating", INTEGER, &swallowfloating },
    144         { "gappih",          INTEGER, &gappih          },
    145         { "gappiv",          INTEGER, &gappiv          },
    146         { "gappoh",          INTEGER, &gappoh          },
    147         { "gappov",          INTEGER, &gappov          },
    148         { "smartgaps",       INTEGER, &smartgaps       },
    149         { "vertpad",         INTEGER, &vertpad         },
    150         { "sidepad",         INTEGER, &sidepad         },
    151         { "ulinepad",        INTEGER, &ulinepad        },
    152         { "ulinestroke",     INTEGER, &ulinestroke     },
    153         { "ulinevoffset",    INTEGER, &ulinevoffset    },
    154         { "ulineall",        INTEGER, &ulineall        },
    155 };
    156 
    157 // keys
    158 static Key keys[] = {
    159  // modifier          key        function          argument
    160   { MODKEY,           XK_F1,     spawn,            SHCMD("vol.sh -t")                                       },
    161   { MODKEY,           XK_F2,     spawn,            SHCMD("vol.sh - 1")                                      },
    162   { MODKEY,           XK_F3,     spawn,            SHCMD("vol.sh + 1")                                      },
    163   { MODKEY,           XK_F5,     spawn,            SHCMD("light.sh - 1")                                    },
    164   { MODKEY,           XK_F6,     spawn,            SHCMD("light.sh + 1")                                    },
    165     TAGKEYS(          XK_1,                        0                                                        )
    166     TAGKEYS(          XK_2,                        1                                                        )
    167     TAGKEYS(          XK_3,                        2                                                        )
    168     TAGKEYS(          XK_4,                        3                                                        )
    169     TAGKEYS(          XK_5,                        4                                                        )
    170     TAGKEYS(          XK_6,                        5                                                        )
    171     TAGKEYS(          XK_7,                        6                                                        )
    172     TAGKEYS(          XK_8,                        7                                                        )
    173     TAGKEYS(          XK_9,                        8                                                        )
    174     TAGKEYS(          XK_0,                        9                                                        )
    175   { 0,                XK_Print,  spawn,            SHCMD("shot.sh")                                         },
    176   { MODKEY,           XK_minus,  incrgaps,       { .i = -1 }                                                },
    177   { MODKEY,           XK_equal,  incrgaps,       { .i = +1 }                                                },
    178   { MODKEY,           XK_Tab,    view,           { 0 }                                                      },
    179   { MODKEY,           XK_q,      spawn,            SHCMD("sys.sh")                                          },
    180   { MODKEY,           XK_w,      spawn,            SHCMD("${BROWSER}")                                      },
    181   { MODKEY,           XK_e,      spawn,            SHCMD("mail.sh -o")                                      },
    182   { MODKEY,           XK_r,      reload,         { .v = NULL }                                              },
    183   { MODKEY|ShiftMask, XK_r,      quit,           { 1 }                                                      },
    184   { MODKEY,           XK_t,      spawn,            SHCMD("${TERMINAL}")                                     },
    185   { MODKEY|ShiftMask, XK_t,      spawn,            SHCMD("torr.sh -o")                                      },
    186   { MODKEY,           XK_u,      spawn,            SHCMD("pkgs.sh -o")                                      },
    187   { MODKEY,           XK_p,      spawn,            SHCMD("music.sh -t")                                     },
    188   { MODKEY|ShiftMask, XK_p,      spawn,            SHCMD("pass.sh")                                         },
    189   { MODKEY,           XK_a,      view,           { .ui = ~0 }                                               },
    190   { MODKEY,           XK_s,      togglesticky,   { 0 }                                                      },
    191   { MODKEY,           XK_d,      spawn,            SHCMD("${MENU}")                                         },
    192   { MODKEY,           XK_f,      spawn,            SHCMD("${TERMINAL} -c ${FILE_VIEWER} -e ${FILE_VIEWER}") },
    193   { MODKEY|ShiftMask, XK_f,      togglefullscr,  { 0 }                                                      },
    194   { MODKEY,           XK_h,      spawn,            SHCMD("hosts.sh")                                        },
    195   { MODKEY,           XK_k,      killclient,     { 0 }                                                      },
    196   { MODKEY,           XK_l,      spawn,            SHCMD("lock.sh")                                         },
    197   { MODKEY,           XK_z,      focusstack,     { .i = -1 }                                                },
    198   { MODKEY,           XK_x,      focusstack,     { .i = +1 }                                                },
    199   { MODKEY,           XK_c,      spawn,            SHCMD("color.sh")                                        },
    200   { MODKEY,           XK_b,      togglebar,      { 0 }                                                      },
    201   { MODKEY,           XK_n,      spawn,            SHCMD("net.sh -o")                                       },
    202   { MODKEY|ShiftMask, XK_n,      spawn,            SHCMD("rss.sh -o")                                       },
    203   { MODKEY,           XK_m,      spawn,            SHCMD("music.sh -o")                                     },
    204   { MODKEY,           XK_comma,  setmfact,       { .f = -0.05 }                                             },
    205   { MODKEY,           XK_period, setmfact,       { .f = +0.05 }                                             },
    206   { MODKEY,           XK_space,  zoom,           { 0 }                                                      },
    207   { MODKEY,           XK_Down,   incnmaster,     { .i = -1 }                                                },
    208   { MODKEY,           XK_Up,     incnmaster,     { .i = +1 }                                                },
    209 };
    210 
    211 // buttons
    212 static Button buttons[] = {
    213    // click          event mask button   function        argument
    214 	{ ClkLtSymbol,   0,         Button1, setlayout,      {0} },
    215 	{ ClkLtSymbol,   0,         Button3, setlayout,      {.v = &layouts[2]} },
    216 	{ ClkStatusText, 0,         Button1, sigstatusbar,   {.i = 1} },
    217 	{ ClkStatusText, 0,         Button2, sigstatusbar,   {.i = 2} },
    218 	{ ClkStatusText, 0,         Button3, sigstatusbar,   {.i = 3} },
    219     { ClkStatusText, 0,         Button4, sigstatusbar,   {.i = 4} },
    220     { ClkStatusText, 0,         Button5, sigstatusbar,   {.i = 5} },
    221 	{ ClkClientWin,  MODKEY,    Button1, movemouse,      {0} },
    222 	{ ClkClientWin,  MODKEY,    Button2, togglefloating, {0} },
    223 	{ ClkClientWin,  MODKEY,    Button3, resizemouse,    {0} },
    224 	{ ClkTagBar,     0,         Button1, view,           {0} },
    225 	{ ClkTagBar,     0,         Button3, toggleview,     {0} },
    226 	{ ClkTagBar,     MODKEY,    Button1, tag,            {0} },
    227 	{ ClkTagBar,     MODKEY,    Button3, toggletag,      {0} },
    228 };
    229 
    230 #include "dwmc.c"
    231 
    232 // signals
    233 static Signal signals[] = {
    234     /* signum           function */
    235     { "focusstack",     focusstack },
    236     { "setmfact",       setmfact },
    237     { "togglebar",      togglebar },
    238     { "incnmaster",     incnmaster },
    239     { "togglefloating", togglefloating },
    240     { "focusmon",       focusmon },
    241     { "tagmon",         tagmon },
    242     { "zoom",           zoom },
    243     { "view",           view },
    244     { "viewall",        viewall },
    245     { "viewex",         viewex },
    246     { "toggleview",     view },
    247     { "toggleviewex",   toggleviewex },
    248     { "tag",            tag },
    249     { "tagall",         tagall },
    250     { "tagex",          tagex },
    251     { "toggletag",      tag },
    252     { "toggletagex",    toggletagex },
    253     { "killclient",     killclient },
    254     { "quit",           quit },
    255     { "setlayout",      setlayout },
    256     { "setlayoutex",    setlayoutex },
    257     { "reload",         reload },
    258 };