JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
floating rules trigger centering too
[dwm.git] / config.def.h
index af735d8..9d9a0e7 100644 (file)
@@ -15,6 +15,7 @@ static const Bool topbar            = True;     /* False means bottom bar */
 
 /* tagging */
 static const char *tags[] = { "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]" };
+// the ENV var WORKSPACE_NUMBER (passed to terminal) will use these names instead:
 static const char *workspace_numbers_str[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
 
 #define TBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, False, -1 },
@@ -35,7 +36,7 @@ static const Rule rules[] = {
        SHBC( 2, "org-openstreetmap-josm-Main") // Josm (both splash and main window)
        SHBC( 5, "Gimp")
        // Tag By Title (matches prefix)
-       // These rules are used to keep terminals in the right workspace accross dwm restarts
+       // These rules are used to keep terminals in the right workspace (tag) accross dwm restarts
        // Put something like this in your .zshrc:
        //     function preexec { echo -ne "\033]0;w$WORKSPACE_NUMBER: $1\a"; }
        //     function precmd { echo -ne "\033]0;w$WORKSPACE_NUMBER: $PWD\a"; }
@@ -80,13 +81,13 @@ static const Layout layouts[] = {
 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";
+char WORKSPACE_NUMBER[] = "WORKSPACE_NUMBER=00"; // if you change the _length_ of this string, update spawn() in dwm.c. This is the ENV var passed to your terminal. The value is pulled from workspace_numbers_str based on the active tag.
 static const char *termcmd[]  = { "env", (const char *)(&(WORKSPACE_NUMBER[0])), "st", NULL };
 
 static Key keys[] = {
        /* modifier                     key        function        argument */
        { 0,                            XK_F1,     spawn,          {.v = dmenucmd } },
-       { 0,                            XK_F2,     spawn,          {.v = termcmd } },
+       { 0,                            XK_F2,     kbspawn,        {.v = termcmd } },
        { MODKEY,                       XK_b,      togglebar,      {0} },
        { MODKEY,                       XK_n,      focusstack,     {.i = +1 } },
        { MODKEY,                       XK_h,      focusstack,     {.i = 0 } },