Add dwm patch 'notags' - sites - public wiki contents of suckless.org
 (HTM) git clone git://git.suckless.org/sites
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 971350095e00bf1222da5e80c57dd297d7ab19cc
 (DIR) parent 55732d60f11616231ea1879443c5d997addd2083
 (HTM) Author: Farlado <stultasergalo@gmail.com>
       Date:   Wed, 18 Jun 2025 22:26:40 -0400
       
       Add dwm patch 'notags'
       
       Diffstat:
         A dwm.suckless.org/patches/notags/dw… |     441 +++++++++++++++++++++++++++++++
         A dwm.suckless.org/patches/notags/in… |      14 ++++++++++++++
       
       2 files changed, 455 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/dwm.suckless.org/patches/notags/dwm-notags-20250618-cfb8627.diff b/dwm.suckless.org/patches/notags/dwm-notags-20250618-cfb8627.diff
       @@ -0,0 +1,441 @@
       +From dad55f720cc88c239253e52690c22d0797961a72 Mon Sep 17 00:00:00 2001
       +From: Farlado <stultasergalo@gmail.com>
       +Date: Wed, 18 Jun 2025 22:12:13 -0400
       +Subject: [PATCH] Remove client tagging
       +
       +---
       + config.def.h |  30 ++----------
       + dwm.c        | 135 ++++++---------------------------------------------
       + 2 files changed, 19 insertions(+), 146 deletions(-)
       +
       +diff --git a/config.def.h b/config.def.h
       +index 9efa774..fbfa63f 100644
       +--- a/config.def.h
       ++++ b/config.def.h
       +@@ -18,17 +18,14 @@ static const char *colors[][3]      = {
       +         [SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
       + };
       + 
       +-/* tagging */
       +-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
       +-
       + static const Rule rules[] = {
       +         /* xprop(1):
       +          *        WM_CLASS(STRING) = instance, class
       +          *        WM_NAME(STRING) = title
       +          */
       +-        /* class      instance    title       tags mask     isfloating   monitor */
       +-        { "Gimp",     NULL,       NULL,       0,            1,           -1 },
       +-        { "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
       ++        /* class      instance    title       isfloating   monitor */
       ++        { "Gimp",     NULL,       NULL,       1,           -1 },
       ++        { "Firefox",  NULL,       NULL,       0,           -1 },
       + };
       + 
       + /* layout(s) */
       +@@ -46,11 +43,6 @@ static const Layout layouts[] = {
       + 
       + /* key definitions */
       + #define MODKEY Mod1Mask
       +-#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 } }
       +@@ -72,28 +64,16 @@ static const Key keys[] = {
       +         { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
       +         { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
       +         { MODKEY,                       XK_Return, zoom,           {0} },
       +-        { MODKEY,                       XK_Tab,    view,           {0} },
       +         { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
       +         { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
       +         { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
       +         { MODKEY,                       XK_m,      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 } },
       +-        TAGKEYS(                        XK_1,                      0)
       +-        TAGKEYS(                        XK_2,                      1)
       +-        TAGKEYS(                        XK_3,                      2)
       +-        TAGKEYS(                        XK_4,                      3)
       +-        TAGKEYS(                        XK_5,                      4)
       +-        TAGKEYS(                        XK_6,                      5)
       +-        TAGKEYS(                        XK_7,                      6)
       +-        TAGKEYS(                        XK_8,                      7)
       +-        TAGKEYS(                        XK_9,                      8)
       +         { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
       + };
       + 
       +@@ -108,9 +88,5 @@ static const Button buttons[] = {
       +         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
       +         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
       +         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
       +-        { ClkTagBar,            0,              Button1,        view,           {0} },
       +-        { ClkTagBar,            0,              Button3,        toggleview,     {0} },
       +-        { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
       +-        { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
       + };
       + 
       +diff --git a/dwm.c b/dwm.c
       +index 1443802..ace2a3b 100644
       +--- a/dwm.c
       ++++ b/dwm.c
       +@@ -13,10 +13,9 @@
       +  * Each child of the root window is called a client, except windows which have
       +  * set the override_redirect flag. Clients are organized in a linked client
       +  * list on each monitor, the focus history is remembered through a stack list
       +- * on each monitor. Each client contains a bit array to indicate the tags of a
       +- * client.
       ++ * on each monitor.
       +  *
       +- * Keys and tagging rules are organized as arrays and defined in config.h.
       ++ * Keys are organized as arrays and defined in config.h.
       +  *
       +  * To understand everything else, start reading main().
       +  */
       +@@ -49,11 +48,10 @@
       + #define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
       + #define INTERSECT(x,y,w,h,m)    (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
       +                                * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
       +-#define ISVISIBLE(C)            ((C->tags & C->mon->tagset[C->mon->seltags]))
       ++#define ISVISIBLE(C)            1 /* FIXME: I am lazy and for now this isn't causing unexpected behavior on my end */
       + #define MOUSEMASK               (BUTTONMASK|PointerMotionMask)
       + #define WIDTH(X)                ((X)->w + 2 * (X)->bw)
       + #define HEIGHT(X)               ((X)->h + 2 * (X)->bw)
       +-#define TAGMASK                 ((1 << LENGTH(tags)) - 1)
       + #define TEXTW(X)                (drw_fontset_getwidth(drw, (X)) + lrpad)
       + 
       + /* enums */
       +@@ -90,7 +88,6 @@ struct Client {
       +         int oldx, oldy, oldw, oldh;
       +         int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid;
       +         int bw, oldbw;
       +-        unsigned int tags;
       +         int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
       +         Client *next;
       +         Client *snext;
       +@@ -118,9 +115,7 @@ struct Monitor {
       +         int by;               /* bar geometry */
       +         int mx, my, mw, mh;   /* screen size */
       +         int wx, wy, ww, wh;   /* window area  */
       +-        unsigned int seltags;
       +         unsigned int sellt;
       +-        unsigned int tagset[2];
       +         int showbar;
       +         int topbar;
       +         Client *clients;
       +@@ -135,7 +130,6 @@ typedef struct {
       +         const char *class;
       +         const char *instance;
       +         const char *title;
       +-        unsigned int tags;
       +         int isfloating;
       +         int monitor;
       + } Rule;
       +@@ -205,13 +199,10 @@ static void setup(void);
       + static void seturgent(Client *c, int urg);
       + static void showhide(Client *c);
       + static void spawn(const Arg *arg);
       +-static void tag(const Arg *arg);
       + static void tagmon(const Arg *arg);
       + static void tile(Monitor *m);
       + static void togglebar(const Arg *arg);
       + static void togglefloating(const Arg *arg);
       +-static void toggletag(const Arg *arg);
       +-static void toggleview(const Arg *arg);
       + static void unfocus(Client *c, int setfocus);
       + static void unmanage(Client *c, int destroyed);
       + static void unmapnotify(XEvent *e);
       +@@ -225,7 +216,6 @@ static void updatestatus(void);
       + static void updatetitle(Client *c);
       + static void updatewindowtype(Client *c);
       + static void updatewmhints(Client *c);
       +-static void view(const Arg *arg);
       + static Client *wintoclient(Window w);
       + static Monitor *wintomon(Window w);
       + static int xerror(Display *dpy, XErrorEvent *ee);
       +@@ -270,9 +260,6 @@ static Window root, wmcheckwin;
       + /* configuration, allows nested code to access above variables */
       + #include "config.h"
       + 
       +-/* compile-time check if all tags fit into an unsigned int bit array. */
       +-struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
       +-
       + /* function implementations */
       + void
       + applyrules(Client *c)
       +@@ -285,7 +272,6 @@ applyrules(Client *c)
       + 
       +         /* rule matching */
       +         c->isfloating = 0;
       +-        c->tags = 0;
       +         XGetClassHint(dpy, c->win, &ch);
       +         class    = ch.res_class ? ch.res_class : broken;
       +         instance = ch.res_name  ? ch.res_name  : broken;
       +@@ -297,7 +283,6 @@ applyrules(Client *c)
       +                 && (!r->instance || strstr(instance, r->instance)))
       +                 {
       +                         c->isfloating = r->isfloating;
       +-                        c->tags |= r->tags;
       +                         for (m = mons; m && m->num != r->monitor; m = m->next);
       +                         if (m)
       +                                 c->mon = m;
       +@@ -307,7 +292,6 @@ applyrules(Client *c)
       +                 XFree(ch.res_class);
       +         if (ch.res_name)
       +                 XFree(ch.res_name);
       +-        c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
       + }
       + 
       + int
       +@@ -417,7 +401,7 @@ attachstack(Client *c)
       + void
       + buttonpress(XEvent *e)
       + {
       +-        unsigned int i, x, click;
       ++        unsigned int i, click;
       +         Arg arg = {0};
       +         Client *c;
       +         Monitor *m;
       +@@ -431,14 +415,7 @@ buttonpress(XEvent *e)
       +                 focus(NULL);
       +         }
       +         if (ev->window == selmon->barwin) {
       +-                i = x = 0;
       +-                do
       +-                        x += TEXTW(tags[i]);
       +-                while (ev->x >= x && ++i < LENGTH(tags));
       +-                if (i < LENGTH(tags)) {
       +-                        click = ClkTagBar;
       +-                        arg.ui = 1 << i;
       +-                } else if (ev->x < x + TEXTW(selmon->ltsymbol))
       ++                if (ev->x < TEXTW(selmon->ltsymbol))
       +                         click = ClkLtSymbol;
       +                 else if (ev->x > selmon->ww - (int)TEXTW(stext))
       +                         click = ClkStatusText;
       +@@ -470,12 +447,10 @@ checkotherwm(void)
       + void
       + cleanup(void)
       + {
       +-        Arg a = {.ui = ~0};
       +         Layout foo = { "", NULL };
       +         Monitor *m;
       +         size_t i;
       + 
       +-        view(&a);
       +         selmon->lt[selmon->sellt] = &foo;
       +         for (m = mons; m; m = m->next)
       +                 while (m->stack)
       +@@ -612,8 +587,7 @@ configurerequest(XEvent *e)
       +                                 c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */
       +                         if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
       +                                 configure(c);
       +-                        if (ISVISIBLE(c))
       +-                                XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
       ++                        XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
       +                 } else
       +                         configure(c);
       +         } else {
       +@@ -635,7 +609,6 @@ createmon(void)
       +         Monitor *m;
       + 
       +         m = ecalloc(1, sizeof(Monitor));
       +-        m->tagset[0] = m->tagset[1] = 1;
       +         m->mfact = mfact;
       +         m->nmaster = nmaster;
       +         m->showbar = showbar;
       +@@ -700,35 +673,18 @@ drawbar(Monitor *m)
       +         int x, w, tw = 0;
       +         int boxs = drw->fonts->h / 9;
       +         int boxw = drw->fonts->h / 6 + 2;
       +-        unsigned int i, occ = 0, urg = 0;
       +-        Client *c;
       + 
       +         if (!m->showbar)
       +                 return;
       + 
       +-        /* draw status first so it can be overdrawn by tags later */
       ++        /* draw status first so it can be overdrawn later */
       +         if (m == selmon) { /* status is only drawn on selected monitor */
       +                 drw_setscheme(drw, scheme[SchemeNorm]);
       +                 tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
       +                 drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
       +         }
       + 
       +-        for (c = m->clients; c; c = c->next) {
       +-                occ |= c->tags;
       +-                if (c->isurgent)
       +-                        urg |= c->tags;
       +-        }
       +         x = 0;
       +-        for (i = 0; i < LENGTH(tags); i++) {
       +-                w = TEXTW(tags[i]);
       +-                drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
       +-                drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
       +-                if (occ & 1 << i)
       +-                        drw_rect(drw, x + boxs, boxs, boxw, boxw,
       +-                                m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
       +-                                urg & 1 << i);
       +-                x += w;
       +-        }
       +         w = TEXTW(m->ltsymbol);
       +         drw_setscheme(drw, scheme[SchemeNorm]);
       +         x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
       +@@ -851,8 +807,7 @@ focusstack(const Arg *arg)
       +                                 c = i;
       +                 if (!c)
       +                         for (; i; i = i->next)
       +-                                if (ISVISIBLE(i))
       +-                                        c = i;
       ++                                c = i;
       +         }
       +         if (c) {
       +                 focus(c);
       +@@ -1046,7 +1001,6 @@ manage(Window w, XWindowAttributes *wa)
       +         updatetitle(c);
       +         if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
       +                 c->mon = t->mon;
       +-                c->tags = t->tags;
       +         } else {
       +                 c->mon = selmon;
       +                 applyrules(c);
       +@@ -1116,8 +1070,7 @@ monocle(Monitor *m)
       +         Client *c;
       + 
       +         for (c = m->clients; c; c = c->next)
       +-                if (ISVISIBLE(c))
       +-                        n++;
       ++                n++;
       +         if (n > 0) /* override layout symbol */
       +                 snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
       +         for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
       +@@ -1204,7 +1157,7 @@ movemouse(const Arg *arg)
       + Client *
       + nexttiled(Client *c)
       + {
       +-        for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
       ++        for (; c && c->isfloating; c = c->next);
       +         return c;
       + }
       + 
       +@@ -1369,7 +1322,7 @@ restack(Monitor *m)
       +                 wc.stack_mode = Below;
       +                 wc.sibling = m->barwin;
       +                 for (c = m->stack; c; c = c->snext)
       +-                        if (!c->isfloating && ISVISIBLE(c)) {
       ++                        if (!c->isfloating) {
       +                                 XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
       +                                 wc.sibling = c->win;
       +                         }
       +@@ -1425,7 +1378,6 @@ sendmon(Client *c, Monitor *m)
       +         detach(c);
       +         detachstack(c);
       +         c->mon = m;
       +-        c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
       +         attach(c);
       +         attachstack(c);
       +         focus(NULL);
       +@@ -1630,17 +1582,11 @@ showhide(Client *c)
       + {
       +         if (!c)
       +                 return;
       +-        if (ISVISIBLE(c)) {
       +-                /* show clients top down */
       +-                XMoveWindow(dpy, c->win, c->x, c->y);
       +-                if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
       +-                        resize(c, c->x, c->y, c->w, c->h, 0);
       +-                showhide(c->snext);
       +-        } else {
       +-                /* hide clients bottom up */
       +-                showhide(c->snext);
       +-                XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
       +-        }
       ++        /* show clients top down */
       ++        XMoveWindow(dpy, c->win, c->x, c->y);
       ++        if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
       ++                resize(c, c->x, c->y, c->w, c->h, 0);
       ++        showhide(c->snext);
       + }
       + 
       + void
       +@@ -1665,16 +1611,6 @@ spawn(const Arg *arg)
       +         }
       + }
       + 
       +-void
       +-tag(const Arg *arg)
       +-{
       +-        if (selmon->sel && arg->ui & TAGMASK) {
       +-                selmon->sel->tags = arg->ui & TAGMASK;
       +-                focus(NULL);
       +-                arrange(selmon);
       +-        }
       +-}
       +-
       + void
       + tagmon(const Arg *arg)
       + {
       +@@ -1734,33 +1670,6 @@ togglefloating(const Arg *arg)
       +         arrange(selmon);
       + }
       + 
       +-void
       +-toggletag(const Arg *arg)
       +-{
       +-        unsigned int newtags;
       +-
       +-        if (!selmon->sel)
       +-                return;
       +-        newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
       +-        if (newtags) {
       +-                selmon->sel->tags = newtags;
       +-                focus(NULL);
       +-                arrange(selmon);
       +-        }
       +-}
       +-
       +-void
       +-toggleview(const Arg *arg)
       +-{
       +-        unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
       +-
       +-        if (newtagset) {
       +-                selmon->tagset[selmon->seltags] = newtagset;
       +-                focus(NULL);
       +-                arrange(selmon);
       +-        }
       +-}
       +-
       + void
       + unfocus(Client *c, int setfocus)
       + {
       +@@ -2049,18 +1958,6 @@ updatewmhints(Client *c)
       +         }
       + }
       + 
       +-void
       +-view(const Arg *arg)
       +-{
       +-        if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
       +-                return;
       +-        selmon->seltags ^= 1; /* toggle sel tagset */
       +-        if (arg->ui & TAGMASK)
       +-                selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
       +-        focus(NULL);
       +-        arrange(selmon);
       +-}
       +-
       + Client *
       + wintoclient(Window w)
       + {
       +-- 
       +2.49.0
       +
 (DIR) diff --git a/dwm.suckless.org/patches/notags/index.md b/dwm.suckless.org/patches/notags/index.md
       @@ -0,0 +1,14 @@
       +notags
       +======
       +
       +Description
       +-----------
       +Removes client tagging from dwm.
       +
       +Download
       +--------
       +* [dwm-notags-20250618-cfb8627.diff](dwm-notags-20250618-cfb8627.diff)
       +
       +Authors
       +-------
       +* Farlado <stultasergalo@gmail.com>