t* dwm + patches
       
   URI git clone git://git.codevoid.de/dwm-sdk
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 46d79b7c26c0038f03e7a02f8cd1d44a281abb63
   DIR parent f60e596d4c5b9b5a780fe086de9017e959ff5d2e
   URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de>
       Date:   Wed, 23 May 2018 18:07:57 +0200
       
       Adding scratchpad patch
       
       Diffstat:
         M config.def.h                        |       3 +++
         M config.h                            |       5 +++++
         M dwm.c                               |      32 +++++++++++++++++++++++++++++++
       
       3 files changed, 40 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/config.def.h b/config.def.h
       t@@ -64,11 +64,14 @@ static const Layout layouts[] = {
        static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
        static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
        static const char *termcmd[]  = { "st", NULL };
       +static const char scratchpadname[] = "scratchpad";
       +static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
        
        static Key keys[] = {
                /* modifier                     key        function        argument */
                { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
                { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
       +        { MODKEY,                       XK_grave,  togglescratch,  {.v = scratchpadcmd } },
                { MODKEY,                       XK_b,      togglebar,      {0} },
                { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
                { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
   DIR diff --git a/config.h b/config.h
       t@@ -63,6 +63,9 @@ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont,
        static const char *termcmd[]  = { "st", NULL };
        static const char *bigtermcmd[]  = { "st", "-f FuraCode Nerd Font:size=20:antialias=false:autohint=false", NULL };
        static const char *browsercmd[]  = { ".dwm/browser", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
       +static const char *passmenucmd[]  = { ".dwm/passmenu", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
       +static const char scratchpadname[] = "scratchpad";
       +static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
        
        static Key keys[] = {
                /* modifier                     key        function        argument */
       t@@ -71,6 +74,8 @@ static Key keys[] = {
                { MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
                { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = bigtermcmd } },
                { MODKEY|ShiftMask,             XK_f,      spawn,          {.v = browsercmd } },
       +        { MODKEY|ShiftMask,             XK_p,      spawn,          {.v = passmenucmd } },
       +        { MODKEY,                       XK_minus,  togglescratch,  {.v = scratchpadcmd } },
        
                // ui modifier
                { MODKEY,                       XK_b,      togglebar,      {0} },
   DIR diff --git a/dwm.c b/dwm.c
       t@@ -240,6 +240,7 @@ static void tag(const Arg *arg);
        static void tagmon(const Arg *arg);
        static void togglebar(const Arg *arg);
        static void togglefloating(const Arg *arg);
       +static void togglescratch(const Arg *arg);
        static void toggletag(const Arg *arg);
        static void toggleview(const Arg *arg);
        static void unfocus(Client *c, int setfocus);
       t@@ -307,6 +308,8 @@ static Window root, wmcheckwin;
        /* configuration, allows nested code to access above variables */
        #include "config.h"
        
       +static unsigned int scratchtag = 1 << LENGTH(tags);
       +
        /* compile-time check if all tags fit into an unsigned int bit array. */
        struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
        
       t@@ -1162,6 +1165,13 @@ manage(Window w, XWindowAttributes *wa)
                        && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
                c->bw = borderpx;
        
       +        if (!strcmp(c->name, scratchpadname)) {
       +                c->mon->tagset[c->mon->seltags] |= c->tags = scratchtag;
       +                c->isfloating = True;
       +                c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2);
       +                c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
       +        }
       +
                wc.border_width = c->bw;
                XConfigureWindow(dpy, w, CWBorderWidth, &wc);
                XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
       t@@ -1888,6 +1898,28 @@ togglefloating(const Arg *arg)
        }
        
        void
       +togglescratch(const Arg *arg)
       +{
       +        Client *c;
       +        unsigned int found = 0;
       +
       +        for (c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next);
       +        if (found) {
       +                unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
       +                if (newtagset) {
       +                        selmon->tagset[selmon->seltags] = newtagset;
       +                        focus(NULL);
       +                        arrange(selmon);
       +                }
       +                if (ISVISIBLE(c)) {
       +                        focus(c);
       +                        restack(selmon);
       +                }
       +        } else
       +                spawn(arg);
       +}
       +
       +void
        toggletag(const Arg *arg)
        {
                unsigned int newtags;