diff --git a/config.h b/config.h index d4f30c4..f6728fc 100644 --- a/config.h +++ b/config.h @@ -52,15 +52,17 @@ static const Rule rules[] = { * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating isterminal isswallow monitor */ - { "steam", NULL, NULL, 1 << 1, 0, 0, -1 -1 }, - { "Firefox", NULL, NULL, 1 << 2, 0, 0, -1 -1 }, - { "brave-browser", NULL, NULL, 1 << 3, 0, 0, -1 -1 }, - { "discord", NULL, NULL, 1 << 4, 0, 0, -1 -1 }, - { "feishin", NULL, NULL, 1 << 5, 0, 0, -1 -1 }, - { NULL, "spterm", NULL, SPTAG(0), 1, 0, 0, -1 }, - { NULL, "spfm", NULL, SPTAG(1), 1, 0, 0, -1 }, - { NULL, "keepassxc", NULL, SPTAG(2), 0, 0, 0, -1 }, + /* class instance title tags mask isfloating isterminal isswallow monitor */ + { "Playground", NULL, NULL, 0, 1, 0, -1 -1 }, + + { "steam", NULL, NULL, 1 << 1, 0, 0, -1 -1 }, + { "Firefox", NULL, NULL, 1 << 2, 0, 0, -1 -1 }, + { "brave-browser", NULL, NULL, 1 << 3, 0, 0, -1 -1 }, + { "discord", NULL, NULL, 1 << 4, 0, 0, -1 -1 }, + { "feishin", NULL, NULL, 1 << 5, 0, 0, -1 -1 }, + { NULL, "spterm", NULL, SPTAG(0), 1, 0, 0, -1 }, + { NULL, "spfm", NULL, SPTAG(1), 1, 0, 0, -1 }, + { NULL, "keepassxc", NULL, SPTAG(2), 0, 0, 0, -1 }, }; /* layout(s) */ diff --git a/dwm b/dwm index 6973c91..0149747 100755 Binary files a/dwm and b/dwm differ diff --git a/dwm.o b/dwm.o index d853c49..a6076d9 100644 Binary files a/dwm.o and b/dwm.o differ diff --git a/patches/dwm-placedir-6.6.diff b/patches/dwm-placedir-6.6.diff new file mode 100644 index 0000000..d4e5544 --- /dev/null +++ b/patches/dwm-placedir-6.6.diff @@ -0,0 +1,145 @@ +From e9af0dec465dc85cf507c9b44d9ac87e868f30fe Mon Sep 17 00:00:00 2001 +From: Bakkeby +Date: Fri, 28 Jun 2024 10:07:47 +0200 +Subject: [PATCH] placedir patch + +Moving clients around with behaviour similar to that of focusdir +--- + config.def.h | 4 +++ + dwm.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 102 insertions(+) + +diff --git a/config.def.h b/config.def.h +index 9efa774..d835024 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -67,6 +67,10 @@ static const Key keys[] = { + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, ++ { MODKEY|ControlMask, XK_Left, placedir, {.i = 0 } }, // left ++ { MODKEY|ControlMask, XK_Right, placedir, {.i = 1 } }, // right ++ { MODKEY|ControlMask, XK_Up, placedir, {.i = 2 } }, // up ++ { MODKEY|ControlMask, XK_Down, placedir, {.i = 3 } }, // down + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, +diff --git a/dwm.c b/dwm.c +index 1443802..3ac0a7f 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -184,6 +184,7 @@ static void monocle(Monitor *m); + static void motionnotify(XEvent *e); + static void movemouse(const Arg *arg); + static Client *nexttiled(Client *c); ++static void placedir(const Arg *arg); + static void pop(Client *c); + static void propertynotify(XEvent *e); + static void quit(const Arg *arg); +@@ -1208,6 +1209,103 @@ nexttiled(Client *c) + return c; + } + ++void ++placedir(const Arg *arg) ++{ ++ Client *s = selmon->sel, *f = NULL, *c, *next, *fprior, *sprior; ++ ++ if (!s || s->isfloating) ++ return; ++ ++ unsigned int score = -1; ++ unsigned int client_score; ++ int dist; ++ int dirweight = 20; ++ ++ next = s->next; ++ if (!next) ++ next = s->mon->clients; ++ for (c = next; c != s; c = next) { ++ ++ next = c->next; ++ if (!next) ++ next = s->mon->clients; ++ ++ if (!ISVISIBLE(c)) // || HIDDEN(c) ++ continue; ++ ++ switch (arg->i) { ++ case 0: // left ++ dist = s->x - c->x - c->w; ++ client_score = ++ dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) + ++ abs(s->y - c->y); ++ break; ++ case 1: // right ++ dist = c->x - s->x - s->w; ++ client_score = ++ dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) + ++ abs(c->y - s->y); ++ break; ++ case 2: // up ++ dist = s->y - c->y - c->h; ++ client_score = ++ dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) + ++ abs(s->x - c->x); ++ break; ++ default: ++ case 3: // down ++ dist = c->y - s->y - s->h; ++ client_score = ++ dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) + ++ abs(c->x - s->x); ++ break; ++ } ++ ++ if (((arg->i == 0 || arg->i == 2) && client_score <= score) || client_score < score) { ++ score = client_score; ++ f = c; ++ } ++ } ++ ++ if (f && f != s) { ++ for (fprior = f->mon->clients; fprior && fprior->next != f; fprior = fprior->next); ++ for (sprior = s->mon->clients; sprior && sprior->next != s; sprior = sprior->next); ++ ++ if (s == fprior) { ++ next = f->next; ++ if (sprior) ++ sprior->next = f; ++ else ++ f->mon->clients = f; ++ f->next = s; ++ s->next = next; ++ } else if (f == sprior) { ++ next = s->next; ++ if (fprior) ++ fprior->next = s; ++ else ++ s->mon->clients = s; ++ s->next = f; ++ f->next = next; ++ } else { // clients are not adjacent to each other ++ next = f->next; ++ f->next = s->next; ++ s->next = next; ++ if (fprior) ++ fprior->next = s; ++ else ++ s->mon->clients = s; ++ if (sprior) ++ sprior->next = f; ++ else ++ f->mon->clients = f; ++ } ++ ++ arrange(f->mon); ++ } ++} ++ + void + pop(Client *c) + { +-- +2.50.1 +