all repos — dwm @ 3b08d2139032fab5dbe5872c40d2e767354d7c91

fork of suckless dynamic window manager

config.def.h (view raw)

  1/* See LICENSE file for copyright and license details. */
  2
  3/* appearance */
  4static const unsigned int borderpx  = 1;        /* border pixel of windows */
  5static const unsigned int snap      = 32;       /* snap pixel */
  6static const int showbar            = 1;        /* 0 means no bar */
  7static const int topbar             = 1;        /* 0 means bottom bar */
  8static const char *fonts[]          = { "Lato Medium:size=11", "PuLukin:size=16:hinting=true:antialias=true" };
  9static const char dmenufont[]       = "JetBrains Mono Medium:size=11";
 10static const char norm_fg[]         = "#cadcde";
 11static const char norm_bg[]         = "#19191a";
 12static const char norm_border[]     = "#393838";
 13static const char sel_fg[]          = "#c7ea76";
 14static const char sel_bg[]          = "#5a514b";
 15static const char sel_border[]      = "#5a514b";
 16static const char *colors[][3]      = {
 17    /*               fg         bg          border   */
 18    [SchemeNorm] = { norm_fg,   norm_bg,    norm_border },
 19    [SchemeSel]  = { sel_fg,    sel_bg,     sel_border },
 20};
 21
 22/* tagging */
 23static const char *tags[] = {
 24    /* latin */
 25/* "sona",  "musi", "pali", "lipu", "poki", "toki", "suli", "lukin", "ante" */
 26    /* pu lukin */
 27    "",    "",    "",    "",    "",    "",    "",    "",    ""
 28};
 29
 30static const Rule rules[] = {
 31    /* xprop(1):
 32     *  WM_CLASS(STRING) = instance, class
 33     *  WM_NAME(STRING) = title
 34     */
 35    /* class            instance    title       tags mask     isfloating   monitor */
 36    { "Qalculate-gtk",  NULL,       NULL,       0,            1,           -1 },
 37    { "Nitrogen",       NULL,       NULL,       0,            1,           -1 },
 38    { "Brave",          NULL,       NULL,       2,            0,           -1 },
 39    { "discord",        NULL,       NULL,       1 << 5,       0,           -1 },
 40    { "Gimp",           NULL,       NULL,       1 << 8,       1,           -1 },
 41    { "Blender",        NULL,       NULL,       1 << 8,       0,           -1 },
 42};
 43
 44/* layout(s) */
 45static const float mfact     = 0.5;     /* factor of master area size [0.05..0.95] */
 46static const int nmaster     = 1;       /* number of clients in master area */
 47static const int resizehints = 1;       /* 1 means respect size hints in tiled resizals */
 48static const int lockfullscreen = 1;    /* 1 will force focus on the fullscreen window */
 49
 50static const Layout layouts[] = {
 51    /* symbol     arrange function */
 52    { "" /* leko */,   tile },    /* first entry is default */
 53    { "" /* kon */,    NULL },    /* no layout function means floating behavior */
 54    { "" /* wan */,    monocle },
 55};
 56
 57/* key definitions */
 58#define MODKEY Mod4Mask
 59#define TAGKEYS(KEY,TAG) \
 60    { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
 61    { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
 62    { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
 63    { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
 64
 65/* helper for spawning shell commands in the pre dwm-5.0 fashion */
 66#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
 67
 68/* commands */
 69static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
 70static const char *dmenucmd[] = {
 71    "dmenu_run", "-m", dmenumon, "-fn", dmenufont,
 72    "-nb", norm_bg, "-nf", norm_fg, "-sb", sel_bg, "-sf", sel_fg, NULL
 73};
 74static const char *termcmd[]  = { "alacritty", NULL };
 75static const char *editorcmd[] = { "emacsclient", "-c", NULL };
 76static const char *browsercmd[] = { "brave", NULL };
 77
 78/* scrot */
 79static const char *scrot_full[] = { "scrot_cmd", "--full", NULL };
 80static const char *scrot_focused[] = { "scrot_cmd", "--focused", NULL };
 81static const char *scrot_area[] = { "scrot_cmd", "--area", NULL };
 82
 83static Key keys[] = {
 84    /* modifier                     key        function        argument */
 85    { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
 86    { MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
 87    { MODKEY|ShiftMask,             XK_e,      spawn,          {.v = editorcmd } },
 88    { MODKEY,                       XK_w,      spawn,          {.v = browsercmd } },
 89    { 0,                            XK_Print,  spawn,          {.v = scrot_full } },
 90    { ControlMask,                  XK_Print,  spawn,          {.v = scrot_area } },
 91    { Mod1Mask,                     XK_Print,  spawn,          {.v = scrot_focused } },
 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.01} },
 98    { MODKEY,                       XK_l,      setmfact,       {.f = +0.01} },
 99    { MODKEY|ShiftMask,             XK_m,      zoom,           {0} },
100    { MODKEY,                       XK_Tab,    view,           {0} },
101    { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
102    { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
103    { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
104    { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
105    { MODKEY,                       XK_space,  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    TAGKEYS(                        XK_1,                      0)
114    TAGKEYS(                        XK_2,                      1)
115    TAGKEYS(                        XK_3,                      2)
116    TAGKEYS(                        XK_4,                      3)
117    TAGKEYS(                        XK_5,                      4)
118    TAGKEYS(                        XK_6,                      5)
119    TAGKEYS(                        XK_7,                      6)
120    TAGKEYS(                        XK_8,                      7)
121    TAGKEYS(                        XK_9,                      8)
122    { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
123};
124
125/* button definitions */
126/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
127static Button buttons[] = {
128    /* click                event mask      button          function        argument */
129    { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
130    { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
131    { ClkWinTitle,          0,              Button2,        zoom,           {0} },
132    { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
133    { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
134    { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
135    { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
136    { ClkTagBar,            0,              Button1,        view,           {0} },
137    { ClkTagBar,            0,              Button3,        toggleview,     {0} },
138    { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
139    { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
140};
141