From: Jason Woofenden Date: Thu, 26 Mar 2015 21:20:36 +0000 (-0400) Subject: splain WORKSPACE_NUMBER X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=commitdiff_plain;h=00ccca79cb9e2ebe4714e8dca6ad414292d3feb4 splain WORKSPACE_NUMBER --- diff --git a/config.def.h b/config.def.h index af735d8..2dc0620 100644 --- a/config.def.h +++ b/config.def.h @@ -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,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 }; -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[] = {