JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
splain WORKSPACE_NUMBER
authorJason Woofenden <jason@jasonwoof.com>
Thu, 26 Mar 2015 21:20:36 +0000 (17:20 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 26 Mar 2015 21:20:36 +0000 (17:20 -0400)
config.def.h

index af735d8..2dc0620 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", "[", "]" };
 
 /* 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 },
 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)
        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"; }
        // 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,7 +81,7 @@ 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 };
 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[] = {
 static const char *termcmd[]  = { "env", (const char *)(&(WORKSPACE_NUMBER[0])), "st", NULL };
 
 static Key keys[] = {