1 /* See LICENSE file for copyright and license details. */
4 static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
5 static const char normbordercolor[] = "#444444";
6 static const char normbgcolor[] = "#222222";
7 static const char normfgcolor[] = "#bbbbbb";
8 static const char selbordercolor[] = "#005577";
9 static const char selbgcolor[] = "#005577";
10 static const char selfgcolor[] = "#eeeeee";
11 static const unsigned int borderpx = 0; /* border pixel of windows. leave at 0, use xcompmgr to show focus instead. */
12 static const unsigned int snap = 32; /* snap pixel */
13 static const Bool showbar = True; /* False means no bar */
14 static const Bool topbar = True; /* False means bottom bar */
17 static const char *tags[] = { "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]" };
18 static const char *workspace_numbers_str[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
20 #define TBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, False, -1 },
21 #define TBT(tag, title) { NULL, NULL, title, 1 << tag, False, False, -1 },
22 #define SHBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, True, -1 },
23 static const Rule rules[] = {
25 * WM_CLASS(STRING) = instance, class
26 * WM_NAME(STRING) = title
33 // Screen Hog (By class) + tag
35 SHBC( 2, "org-openstreetmap-josm-Main") // Josm (both splash and main window)
37 // Tag By Title (matches prefix)
38 // These rules are used to keep terminals in the right workspace accross dwm restarts
39 // Put something like this in your .zshrc:
40 // function preexec { echo -ne "\033]0;w$WORKSPACE_NUMBER: $1\a"; }
41 // function precmd { echo -ne "\033]0;w$WORKSPACE_NUMBER: $PWD\a"; }
57 static const float mfact = 0.595; /* factor of master area size [0.05..0.95] */
58 static const int nmaster = 1; /* number of clients in master area. This setting probably does nothing */
59 static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
61 static const Layout layouts[] = {
62 /* symbol arrange function */
63 { " ", jason_layout },
64 { "Flo", NULL }, // floating (don't think this gets used ever)
65 { " ", monocle }, // symbol is ignored
69 #define MODKEY Mod4Mask
70 #define TAGKEYS(KEY,TAG) \
71 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
72 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
73 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
74 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
76 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
77 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
80 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
81 //static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
82 static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
83 char WORKSPACE_NUMBER[] = "WORKSPACE_NUMBER=00";
84 static const char *termcmd[] = { "env", (const char *)(&(WORKSPACE_NUMBER[0])), "st", NULL };
87 /* modifier key function argument */
88 { 0, XK_F1, spawn, {.v = dmenucmd } },
89 { 0, XK_F2, spawn, {.v = termcmd } },
90 { MODKEY, XK_b, togglebar, {0} },
91 { MODKEY, XK_n, focusstack, {.i = +1 } },
92 { MODKEY, XK_h, focusstack, {.i = 0 } },
93 // { MODKEY, XK_i, incnmaster, {.i = +1 } },
94 // { MODKEY, XK_d, incnmaster, {.i = -1 } },
95 { MODKEY|ControlMask, XK_h, setmfact, {.f = -0.05} },
96 { MODKEY|ControlMask, XK_n, setmfact, {.f = +0.05} },
97 { MODKEY|ShiftMask, XK_h, zoom, {0} },
98 { MODKEY, XK_Tab, view, {0} },
99 { MODKEY, XK_w, killclient, {0} },
100 { MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[0]} },
101 { MODKEY|ShiftMask|ControlMask, XK_f, setlayout, {.v = &layouts[1]} },
102 { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
103 // { MODKEY, XK_space, setlayout, {0} },
104 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
105 // { MODKEY, XK_0, view, {.ui = ~0 } },
106 // { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
107 // { MODKEY, XK_comma, focusmon, {.i = -1 } },
108 // { MODKEY, XK_period, focusmon, {.i = +1 } },
109 // { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
110 // { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
111 TAGKEYS( XK_grave, 0)
122 TAGKEYS( XK_bracketleft, 11)
123 TAGKEYS( XK_bracketright, 12)
124 { MODKEY|ShiftMask, XK_q, quit, {0} },
127 /* button definitions */
128 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
129 static Button buttons[] = {
130 /* click event mask button function argument */
131 { ClkLtSymbol, 0, Button1, setlayout, {0} },
132 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
133 { ClkWinTitle, 0, Button2, zoom, {0} },
134 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
135 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
136 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
137 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
138 { ClkTagBar, 0, Button1, view, {0} },
139 { ClkTagBar, 0, Button3, toggleview, {0} },
140 { ClkTagBar, MODKEY, Button1, tag, {0} },
141 { ClkTagBar, MODKEY, Button3, toggletag, {0} },