-#define MODKEY Mod1Mask
-Key keys[] = {
- /* modifier key function argument */
- { MODKEY, XK_p, spawn, (char *)"exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
- { MODKEY|ShiftMask, XK_Return, spawn, (char *)"exec uxterm" },
- { MODKEY, XK_b, togglebar, NULL },
- { MODKEY, XK_j, focusnext, NULL },
- { MODKEY, XK_k, focusprev, NULL },
- { MODKEY, XK_h, setmfact, (double[]){-0.05} },
- { MODKEY, XK_l, setmfact, (double[]){+0.05} },
- { MODKEY, XK_Return, zoom, NULL },
- { MODKEY, XK_Tab, viewprevtag, NULL },
- { MODKEY|ShiftMask, XK_c, killclient, NULL },
- { MODKEY, XK_space, togglelayout, NULL },
- { MODKEY|ShiftMask, XK_space, togglefloating, NULL },
- { MODKEY, XK_0, view, (int[]){ ~0 } },
- { MODKEY, XK_1, view, (int[]){ 1 << 0 } },
- { MODKEY, XK_2, view, (int[]){ 1 << 1 } },
- { MODKEY, XK_3, view, (int[]){ 1 << 2 } },
- { MODKEY, XK_4, view, (int[]){ 1 << 3 } },
- { MODKEY, XK_5, view, (int[]){ 1 << 4 } },
- { MODKEY, XK_6, view, (int[]){ 1 << 5 } },
- { MODKEY, XK_7, view, (int[]){ 1 << 6 } },
- { MODKEY, XK_8, view, (int[]){ 1 << 7 } },
- { MODKEY, XK_9, view, (int[]){ 1 << 8 } },
- { MODKEY|ControlMask, XK_1, toggleview, (int[]){ 1 << 0 } },
- { MODKEY|ControlMask, XK_2, toggleview, (int[]){ 1 << 1 } },
- { MODKEY|ControlMask, XK_3, toggleview, (int[]){ 1 << 2 } },
- { MODKEY|ControlMask, XK_4, toggleview, (int[]){ 1 << 3 } },
- { MODKEY|ControlMask, XK_5, toggleview, (int[]){ 1 << 4 } },
- { MODKEY|ControlMask, XK_6, toggleview, (int[]){ 1 << 5 } },
- { MODKEY|ControlMask, XK_7, toggleview, (int[]){ 1 << 6 } },
- { MODKEY|ControlMask, XK_8, toggleview, (int[]){ 1 << 7 } },
- { MODKEY|ControlMask, XK_9, toggleview, (int[]){ 1 << 8 } },
- { MODKEY|ShiftMask, XK_0, tag, (int[]){ ~0 } },
- { MODKEY|ShiftMask, XK_1, tag, (int[]){ 1 << 0 } },
- { MODKEY|ShiftMask, XK_2, tag, (int[]){ 1 << 1 } },
- { MODKEY|ShiftMask, XK_3, tag, (int[]){ 1 << 2 } },
- { MODKEY|ShiftMask, XK_4, tag, (int[]){ 1 << 3 } },
- { MODKEY|ShiftMask, XK_5, tag, (int[]){ 1 << 4 } },
- { MODKEY|ShiftMask, XK_6, tag, (int[]){ 1 << 5 } },
- { MODKEY|ShiftMask, XK_7, tag, (int[]){ 1 << 6 } },
- { MODKEY|ShiftMask, XK_8, tag, (int[]){ 1 << 7 } },
- { MODKEY|ShiftMask, XK_9, tag, (int[]){ 1 << 8 } },
- { MODKEY|ControlMask|ShiftMask, XK_1, toggletag, (int[]){ 1 << 0 } },
- { MODKEY|ControlMask|ShiftMask, XK_2, toggletag, (int[]){ 1 << 1 } },
- { MODKEY|ControlMask|ShiftMask, XK_3, toggletag, (int[]){ 1 << 2 } },
- { MODKEY|ControlMask|ShiftMask, XK_4, toggletag, (int[]){ 1 << 3 } },
- { MODKEY|ControlMask|ShiftMask, XK_5, toggletag, (int[]){ 1 << 4 } },
- { MODKEY|ControlMask|ShiftMask, XK_6, toggletag, (int[]){ 1 << 5 } },
- { MODKEY|ControlMask|ShiftMask, XK_7, toggletag, (int[]){ 1 << 6 } },
- { MODKEY|ControlMask|ShiftMask, XK_8, toggletag, (int[]){ 1 << 7 } },
- { MODKEY|ControlMask|ShiftMask, XK_9, toggletag, (int[]){ 1 << 8 } },
- { MODKEY|ShiftMask, XK_q, quit, NULL },
+#define MODKEY Mod4Mask
+#define TAGKEYS(KEY,TAG) \
+ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
+ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }
+
+/* helper for spawning shell commands in the pre dwm-5.0 fashion */
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
+/* commands */
+static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+//static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+char WORKSPACE_NUMBER[] = "WORKSPACE_NUMBER=00";
+static const char *termcmd[] = { "env", (const char *)(&(WORKSPACE_NUMBER[0])), "st", NULL };
+
+#define ARGS(...) {.v = (const char *[]) {__VA_ARGS__, NULL}}
+
+static Key keys[] = {
+ /* modifier key function argument */
+ {0, XK_Scroll_Lock, spawn, ARGS("pulseaudio-set-sink", "toggle")},
+ {ControlMask, XK_Scroll_Lock, spawn, ARGS("pulseaudio-set-sink", "headphones")},
+ {ShiftMask, XK_Scroll_Lock, spawn, ARGS("pulseaudio-set-sink", "speakers")},
+ {0, XK_Pause, spawn, ARGS("black", "0.2")},
+ {0, XK_F3, spawn, ARGS("vol", "down")},
+ {0, XF86XK_AudioLowerVolume, spawn, ARGS("vol", "down")},
+ {0, XK_F4, spawn, ARGS("vol", "up")},
+ {0, XF86XK_AudioRaiseVolume, spawn, ARGS("vol", "up")},
+ {0, XF86XK_AudioPrev, spawn, ARGS("sayremote", "back")},
+ {0, XK_F5, spawn, ARGS("sayremote", "back")},
+ {MODKEY, XK_F5, spawn, ARGS("sayremote", "slower")},
+ {0, XF86XK_AudioNext, spawn, ARGS("sayremote", "forward")},
+ {0, XK_F6, spawn, ARGS("sayremote", "forward")},
+ {MODKEY, XK_F6, spawn, ARGS("sayremote", "faster")},
+ {0, XK_F7, spawn, ARGS("sayremote", "pause")},
+ {0, XF86XK_AudioPause, spawn, ARGS("sayremote", "pause")},
+ {0, XF86XK_AudioStop, spawn, ARGS("sayremote", "stop")},
+ {0, XK_F8, spawn, ARGS("sayremote", "stop")},
+ {MODKEY, XK_F8, spawn, ARGS("sayremote", "reset")},
+ {0, XK_F10, spawn, ARGS("sayclip")},
+ {ControlMask, XK_Return, spawn, ARGS("default-browser-clipboard")},
+ {MODKEY, XK_Return, spawn, ARGS("default-browser-debian-bug")},
+ {0, XK_F1, kbspawn, ARGS("run-dialog")},
+ {MODKEY, XK_l, view, {.ui = 1 << 1}},
+ {MODKEY, XK_l, focusstack, {.i = 0}},
+ {MODKEY, XK_l, kbspawn, ARGS("url-dialog")},
+ {0, XK_F2, kbspawn, {.v = termcmd}},
+ {MODKEY, XK_b, togglebar, {0}},
+ {MODKEY, XK_n, focusstack, {.i = +1}},
+ {MODKEY, XK_h, focusstack, {.i = 0}},
+ {MODKEY, XK_c, focusstack, {.i = -1}},
+// {MODKEY, XK_i, incnmaster, {.i = +1}},
+// {MODKEY, XK_d, incnmaster, {.i = -1}},
+ {MODKEY|ControlMask, XK_h, setmfact, {.f = -0.05}},
+ {MODKEY|ControlMask, XK_n, setmfact, {.f = +0.05}},
+ {MODKEY|ShiftMask, XK_h, zoom, {0}},
+ {MODKEY, XK_Tab, view, {0}},
+ {MODKEY, XK_w, killclient, {0}},
+ {MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[0]}},
+ {MODKEY, XK_f, setlayout, {.v = &layouts[2]}},
+// {MODKEY, XK_space, setlayout, {0}},
+ {MODKEY|ShiftMask, XK_space, togglefloating, {0}},
+// {MODKEY, XK_0, view, {.ui = ~0}},
+// {MODKEY|ShiftMask, XK_0, tag, {.ui = ~0}},
+// {MODKEY, XK_comma, focusmon, {.i = -1}},
+// {MODKEY, XK_period, focusmon, {.i = +1}},
+// {MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1}},
+// {MODKEY|ShiftMask, XK_period, tagmon, {.i = +1}},
+ {MODKEY|ShiftMask, XK_q, quit, {0}},
+ TAGKEYS( XK_grave, 0),
+ TAGKEYS( XK_1, 1),
+ TAGKEYS( XK_2, 2),
+ TAGKEYS( XK_3, 3),
+ TAGKEYS( XK_4, 4),
+ TAGKEYS( XK_5, 5),
+ TAGKEYS( XK_6, 6),
+ TAGKEYS( XK_7, 7),
+ TAGKEYS( XK_8, 8),
+ TAGKEYS( XK_9, 9),
+ TAGKEYS( XK_0, 10),
+ TAGKEYS( XK_bracketleft, 11),
+ TAGKEYS( XK_bracketright, 12),