|
| 1 | +/* See LICENSE file for copyright and license details. */ |
| 2 | + |
| 3 | +/* appearance */ |
| 4 | +static const unsigned int refresh_rate = 60; /* matches dwm's mouse event processing to your monitor's refresh rate for smoother window interactions */ |
| 5 | +static const unsigned int enable_noborder = 1; /* toggles noborder feature (0=disabled, 1=enabled) */ |
| 6 | +static const unsigned int borderpx = 1; /* border pixel of windows */ |
| 7 | +static const unsigned int snap = 32; /* snap pixel */ |
| 8 | +static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ |
| 9 | +static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ |
| 10 | +static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ |
| 11 | +static const unsigned int systrayspacing = 2; /* systray spacing */ |
| 12 | +static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ |
| 13 | +static const int showsystray = 1; /* 0 means no systray */ |
| 14 | +static const int showbar = 1; /* 0 means no bar */ |
| 15 | +static const int topbar = 1; /* 0 means bottom bar */ |
| 16 | +#define ICONSIZE 17 /* icon size */ |
| 17 | +#define ICONSPACING 5 /* space between icon and title */ |
| 18 | +#define SHOWWINICON 1 /* 0 means no winicon */ |
| 19 | +static const char *fonts[] = { "monospace:size=10" }; |
| 20 | +static const char dmenufont[] = "monospace:size=10"; |
| 21 | +static const char col_gray1[] = "#222222"; |
| 22 | +static const char col_gray2[] = "#444444"; |
| 23 | +static const char col_gray3[] = "#bbbbbb"; |
| 24 | +static const char col_gray4[] = "#eeeeee"; |
| 25 | +static const char col_cyan[] = "#005577"; |
| 26 | +static const char *colors[][3] = { |
| 27 | + /* fg bg border */ |
| 28 | + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, |
| 29 | + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, |
| 30 | +}; |
| 31 | + |
| 32 | +static const char *const autostart[] = { |
| 33 | + "st", NULL, |
| 34 | + NULL /* terminate */ |
| 35 | +}; |
| 36 | + |
| 37 | +/* tagging */ |
| 38 | +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; |
| 39 | + |
| 40 | +static const char ptagf[] = "[%s %s]"; /* format of a tag label */ |
| 41 | +static const char etagf[] = "[%s]"; /* format of an empty tag */ |
| 42 | +static const int lcaselbl = 0; /* 1 means make tag label lowercase */ |
| 43 | + |
| 44 | +static const Rule rules[] = { |
| 45 | + /* xprop(1): |
| 46 | + * WM_CLASS(STRING) = instance, class |
| 47 | + * WM_NAME(STRING) = title |
| 48 | + */ |
| 49 | + /* class instance title tags mask isfloating isterminal noswallow monitor */ |
| 50 | + { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, |
| 51 | + { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, |
| 52 | + { "St", NULL, NULL, 0, 0, 1, 0, -1 }, |
| 53 | + { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ |
| 54 | +}; |
| 55 | + |
| 56 | +/* layout(s) */ |
| 57 | +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ |
| 58 | +static const int nmaster = 1; /* number of clients in master area */ |
| 59 | +static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ |
| 60 | +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ |
| 61 | + |
| 62 | +static const Layout layouts[] = { |
| 63 | + /* symbol arrange function */ |
| 64 | + { "[]=", tile }, /* first entry is default */ |
| 65 | + { "><>", NULL }, /* no layout function means floating behavior */ |
| 66 | + { "[M]", monocle }, |
| 67 | +}; |
| 68 | + |
| 69 | +/* key definitions */ |
| 70 | +#define MODKEY Mod1Mask |
| 71 | +#define TAGKEYS(KEY,TAG) \ |
| 72 | + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ |
| 73 | + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ |
| 74 | + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ |
| 75 | + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, |
| 76 | + |
| 77 | +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ |
| 78 | +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } |
| 79 | + |
| 80 | +#define STATUSBAR "dwmblocks" |
| 81 | + |
| 82 | +/* commands */ |
| 83 | +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ |
| 84 | +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; |
| 85 | +static const char *termcmd[] = { "st", NULL }; |
| 86 | + |
| 87 | +static Key keys[] = { |
| 88 | + /* modifier key function argument */ |
| 89 | + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, |
| 90 | + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, |
| 91 | + { MODKEY, XK_b, togglebar, {0} }, |
| 92 | + { MODKEY, XK_j, focusstack, {.i = +1 } }, |
| 93 | + { MODKEY, XK_k, focusstack, {.i = -1 } }, |
| 94 | + { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } }, |
| 95 | + { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } }, |
| 96 | + { MODKEY, XK_i, incnmaster, {.i = +1 } }, |
| 97 | + { MODKEY, XK_d, incnmaster, {.i = -1 } }, |
| 98 | + { MODKEY, XK_h, setmfact, {.f = -0.05} }, |
| 99 | + { MODKEY, XK_l, setmfact, {.f = +0.05} }, |
| 100 | + { MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} }, |
| 101 | + { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} }, |
| 102 | + { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} }, |
| 103 | + { MODKEY, XK_Return, zoom, {0} }, |
| 104 | + { MODKEY, XK_Tab, view, {0} }, |
| 105 | + { MODKEY|ShiftMask, XK_c, killclient, {0} }, |
| 106 | + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, |
| 107 | + { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, |
| 108 | + { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, |
| 109 | + { MODKEY|ShiftMask, XK_f, fullscreen, {0} }, |
| 110 | + { MODKEY, XK_space, setlayout, {0} }, |
| 111 | + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, |
| 112 | + { MODKEY|ShiftMask, XK_y, togglefakefullscreen, {0} }, |
| 113 | + { MODKEY, XK_0, view, {.ui = ~0 } }, |
| 114 | + { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, |
| 115 | + { MODKEY, XK_comma, focusmon, {.i = -1 } }, |
| 116 | + { MODKEY, XK_period, focusmon, {.i = +1 } }, |
| 117 | + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, |
| 118 | + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, |
| 119 | + TAGKEYS( XK_1, 0) |
| 120 | + TAGKEYS( XK_2, 1) |
| 121 | + TAGKEYS( XK_3, 2) |
| 122 | + TAGKEYS( XK_4, 3) |
| 123 | + TAGKEYS( XK_5, 4) |
| 124 | + TAGKEYS( XK_6, 5) |
| 125 | + TAGKEYS( XK_7, 6) |
| 126 | + TAGKEYS( XK_8, 7) |
| 127 | + TAGKEYS( XK_9, 8) |
| 128 | + { MODKEY|ShiftMask, XK_q, quit, {0} }, |
| 129 | +}; |
| 130 | + |
| 131 | +/* button definitions */ |
| 132 | +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ |
| 133 | +static Button buttons[] = { |
| 134 | + /* click event mask button function argument */ |
| 135 | + { ClkTagBar, MODKEY, Button1, tag, {0} }, |
| 136 | + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, |
| 137 | + { ClkWinTitle, 0, Button2, zoom, {0} }, |
| 138 | + { ClkStatusText, 0, Button1, sigstatusbar, {.i = 1} }, |
| 139 | + { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2} }, |
| 140 | + { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3} }, |
| 141 | + { ClkClientWin, MODKEY, Button1, moveorplace, {.i = 1} }, |
| 142 | + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, |
| 143 | + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, |
| 144 | + { ClkTagBar, 0, Button1, view, {0} }, |
| 145 | + { ClkTagBar, 0, Button3, toggleview, {0} }, |
| 146 | + { ClkTagBar, MODKEY, Button1, tag, {0} }, |
| 147 | + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, |
| 148 | +}; |
0 commit comments