|
|
|
@ -1,204 +1,7 @@
|
|
|
|
|
From a61429d4ac9e1154703533effc619068c20c3075 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From f679a0a266e4d8c86018612e91ccdf2746ddd654 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: bakkeby <bakkeby@gmail.com>
|
|
|
|
|
Date: Tue, 7 Apr 2020 12:34:15 +0200
|
|
|
|
|
Subject: [PATCH 1/2] pertag patch, keeps layout, mwfact, barpos and nmaster
|
|
|
|
|
per tag
|
|
|
|
|
|
|
|
|
|
Refer to https://dwm.suckless.org/patches/pertag/
|
|
|
|
|
---
|
|
|
|
|
dwm.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
|
|
|
|
|
1 file changed, 86 insertions(+), 7 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/dwm.c b/dwm.c
|
|
|
|
|
index 4465af1..55f8f92 100644
|
|
|
|
|
--- a/dwm.c
|
|
|
|
|
+++ b/dwm.c
|
|
|
|
|
@@ -111,6 +111,7 @@ typedef struct {
|
|
|
|
|
void (*arrange)(Monitor *);
|
|
|
|
|
} Layout;
|
|
|
|
|
|
|
|
|
|
+typedef struct Pertag Pertag;
|
|
|
|
|
struct Monitor {
|
|
|
|
|
char ltsymbol[16];
|
|
|
|
|
float mfact;
|
|
|
|
|
@@ -130,6 +131,7 @@ struct Monitor {
|
|
|
|
|
Monitor *next;
|
|
|
|
|
Window barwin;
|
|
|
|
|
const Layout *lt[2];
|
|
|
|
|
+ Pertag *pertag;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
@@ -271,6 +273,16 @@ static Window root, wmcheckwin;
|
|
|
|
|
/* configuration, allows nested code to access above variables */
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
+struct Pertag {
|
|
|
|
|
+ unsigned int curtag, prevtag; /* current and previous tag */
|
|
|
|
|
+ int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
|
|
|
|
+ float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
|
|
|
|
+ unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
|
|
|
|
|
+ const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
|
|
|
|
|
+ Bool showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
|
|
|
|
|
+ Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
/* compile-time check if all tags fit into an unsigned int bit array. */
|
|
|
|
|
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
|
|
|
|
|
|
|
|
|
@@ -631,6 +643,7 @@ Monitor *
|
|
|
|
|
createmon(void)
|
|
|
|
|
{
|
|
|
|
|
Monitor *m;
|
|
|
|
|
+ int i;
|
|
|
|
|
|
|
|
|
|
m = ecalloc(1, sizeof(Monitor));
|
|
|
|
|
m->tagset[0] = m->tagset[1] = 1;
|
|
|
|
|
@@ -641,6 +654,27 @@ createmon(void)
|
|
|
|
|
m->lt[0] = &layouts[0];
|
|
|
|
|
m->lt[1] = &layouts[1 % LENGTH(layouts)];
|
|
|
|
|
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
|
|
|
|
|
+ if (!(m->pertag = (Pertag *)calloc(1, sizeof(Pertag))))
|
|
|
|
|
+ die("fatal: could not malloc() %u bytes\n", sizeof(Pertag));
|
|
|
|
|
+ m->pertag->curtag = m->pertag->prevtag = 1;
|
|
|
|
|
+ for (i = 0; i <= LENGTH(tags); i++) {
|
|
|
|
|
+ /* init nmaster */
|
|
|
|
|
+ m->pertag->nmasters[i] = m->nmaster;
|
|
|
|
|
+
|
|
|
|
|
+ /* init mfacts */
|
|
|
|
|
+ m->pertag->mfacts[i] = m->mfact;
|
|
|
|
|
+
|
|
|
|
|
+ /* init layouts */
|
|
|
|
|
+ m->pertag->ltidxs[i][0] = m->lt[0];
|
|
|
|
|
+ m->pertag->ltidxs[i][1] = m->lt[1];
|
|
|
|
|
+ m->pertag->sellts[i] = m->sellt;
|
|
|
|
|
+
|
|
|
|
|
+ /* init showbar */
|
|
|
|
|
+ m->pertag->showbars[i] = m->showbar;
|
|
|
|
|
+
|
|
|
|
|
+ /* swap focus and zoomswap*/
|
|
|
|
|
+ m->pertag->prevzooms[i] = NULL;
|
|
|
|
|
+ }
|
|
|
|
|
return m;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -966,7 +1000,7 @@ grabkeys(void)
|
|
|
|
|
void
|
|
|
|
|
incnmaster(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
|
|
|
|
|
+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1500,10 +1534,13 @@ setfullscreen(Client *c, int fullscreen)
|
|
|
|
|
void
|
|
|
|
|
setlayout(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
|
|
|
|
|
- selmon->sellt ^= 1;
|
|
|
|
|
+ if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) {
|
|
|
|
|
+ selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
|
|
|
|
|
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
+ }
|
|
|
|
|
if (arg && arg->v)
|
|
|
|
|
- selmon->lt[selmon->sellt] = (Layout *)arg->v;
|
|
|
|
|
+ selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
|
|
|
|
|
+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
|
|
|
|
|
if (selmon->sel)
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
@@ -1522,7 +1559,7 @@ setmfact(const Arg *arg)
|
|
|
|
|
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
|
|
|
|
|
if (f < 0.1 || f > 0.9)
|
|
|
|
|
return;
|
|
|
|
|
- selmon->mfact = f;
|
|
|
|
|
+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1699,7 +1736,7 @@ tile(Monitor *m)
|
|
|
|
|
void
|
|
|
|
|
togglebar(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
- selmon->showbar = !selmon->showbar;
|
|
|
|
|
+ selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
|
|
|
|
|
updatebarpos(selmon);
|
|
|
|
|
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
@@ -1738,9 +1775,29 @@ void
|
|
|
|
|
toggleview(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
|
|
|
|
|
+ int i;
|
|
|
|
|
|
|
|
|
|
if (newtagset) {
|
|
|
|
|
+ if (newtagset == ~0) {
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
+ selmon->pertag->curtag = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ /* test if the user did not select the same tag */
|
|
|
|
|
+ if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
+ for (i=0; !(newtagset & 1 << i); i++) ;
|
|
|
|
|
+ selmon->pertag->curtag = i + 1;
|
|
|
|
|
+ }
|
|
|
|
|
selmon->tagset[selmon->seltags] = newtagset;
|
|
|
|
|
+
|
|
|
|
|
+ /* apply settings for this view */
|
|
|
|
|
+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
|
|
|
+ if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
|
|
|
+ togglebar(NULL);
|
|
|
|
|
focus(NULL);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
@@ -2035,11 +2092,33 @@ updatewmhints(Client *c)
|
|
|
|
|
void
|
|
|
|
|
view(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
+ int i;
|
|
|
|
|
+ unsigned int tmptag;
|
|
|
|
|
+
|
|
|
|
|
if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
|
|
|
|
|
return;
|
|
|
|
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
|
|
|
|
- if (arg->ui & TAGMASK)
|
|
|
|
|
+ if (arg->ui & TAGMASK) {
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
|
|
|
|
+ if (arg->ui == ~0)
|
|
|
|
|
+ selmon->pertag->curtag = 0;
|
|
|
|
|
+ else {
|
|
|
|
|
+ for (i=0; !(arg->ui & 1 << i); i++) ;
|
|
|
|
|
+ selmon->pertag->curtag = i + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tmptag = selmon->pertag->prevtag;
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
+ selmon->pertag->curtag = tmptag;
|
|
|
|
|
+ }
|
|
|
|
|
+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
|
|
|
+ if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
|
|
|
+ togglebar(NULL);
|
|
|
|
|
focus(NULL);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
--
|
|
|
|
|
2.17.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
From 7ee505def279edd6eec4b8b1156e3606df0911c1 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: bakkeby <bakkeby@gmail.com>
|
|
|
|
|
Date: Fri, 1 May 2020 14:19:11 +0200
|
|
|
|
|
Subject: [PATCH 2/2] flextile-deluxe layout - a re-envisoned and revamped
|
|
|
|
|
Date: Fri, 1 May 2020 22:46:52 +0200
|
|
|
|
|
Subject: [PATCH] flextile-deluxe layout - a re-envisoned and revamped
|
|
|
|
|
flextile
|
|
|
|
|
|
|
|
|
|
Features:
|
|
|
|
@ -225,15 +28,15 @@ Features:
|
|
|
|
|
- supports rmaster like layout mirroring
|
|
|
|
|
---
|
|
|
|
|
config.def.h | 32 +-
|
|
|
|
|
dwm.c | 98 ++++---
|
|
|
|
|
dwm.c | 189 ++++++++----
|
|
|
|
|
flextile-deluxe.c | 727 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
flextile-deluxe.h | 113 +++++++
|
|
|
|
|
4 files changed, 922 insertions(+), 48 deletions(-)
|
|
|
|
|
4 files changed, 1007 insertions(+), 54 deletions(-)
|
|
|
|
|
create mode 100644 flextile-deluxe.c
|
|
|
|
|
create mode 100644 flextile-deluxe.h
|
|
|
|
|
|
|
|
|
|
diff --git a/config.def.h b/config.def.h
|
|
|
|
|
index 1c0b587..1b77309 100644
|
|
|
|
|
index 1c0b587..1df9709 100644
|
|
|
|
|
--- a/config.def.h
|
|
|
|
|
+++ b/config.def.h
|
|
|
|
|
@@ -34,13 +34,26 @@ static const Rule rules[] = {
|
|
|
|
@ -250,7 +53,7 @@ index 1c0b587..1b77309 100644
|
|
|
|
|
- { "[M]", monocle },
|
|
|
|
|
+ /* symbol arrange function, { nmaster, nstack, layout, master axis, stack axis, secondary stack axis } */
|
|
|
|
|
+ { "[]=", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, TOP_TO_BOTTOM, 0, NULL } }, // default tile layout
|
|
|
|
|
+ { "><>", NULL, {0} }, /* no layout function means floating behavior */
|
|
|
|
|
+ { "><>", NULL, {0} }, /* no layout function means floating behavior */
|
|
|
|
|
+ { "[M]", flextile, { -1, -1, NO_SPLIT, MONOCLE, 0, 0, NULL } }, // monocle
|
|
|
|
|
+ { "|||", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // columns (col) layout
|
|
|
|
|
+ { ">M>", flextile, { -1, -1, FLOATING_MASTER, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // floating master
|
|
|
|
@ -293,10 +96,10 @@ index 1c0b587..1b77309 100644
|
|
|
|
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
|
|
|
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
|
|
|
|
diff --git a/dwm.c b/dwm.c
|
|
|
|
|
index 55f8f92..efd00e7 100644
|
|
|
|
|
index 4465af1..efd00e7 100644
|
|
|
|
|
--- a/dwm.c
|
|
|
|
|
+++ b/dwm.c
|
|
|
|
|
@@ -106,15 +106,28 @@ typedef struct {
|
|
|
|
|
@@ -106,14 +106,28 @@ typedef struct {
|
|
|
|
|
const Arg arg;
|
|
|
|
|
} Key;
|
|
|
|
|
|
|
|
|
@ -316,7 +119,7 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
+ LayoutPreset preset;
|
|
|
|
|
} Layout;
|
|
|
|
|
|
|
|
|
|
typedef struct Pertag Pertag;
|
|
|
|
|
+typedef struct Pertag Pertag;
|
|
|
|
|
struct Monitor {
|
|
|
|
|
char ltsymbol[16];
|
|
|
|
|
float mfact;
|
|
|
|
@ -325,7 +128,15 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
int nmaster;
|
|
|
|
|
int num;
|
|
|
|
|
int by; /* bar geometry */
|
|
|
|
|
@@ -182,7 +195,6 @@ static void killclient(const Arg *arg);
|
|
|
|
|
@@ -130,6 +144,7 @@ struct Monitor {
|
|
|
|
|
Monitor *next;
|
|
|
|
|
Window barwin;
|
|
|
|
|
const Layout *lt[2];
|
|
|
|
|
+ Pertag *pertag;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
@@ -180,7 +195,6 @@ static void killclient(const Arg *arg);
|
|
|
|
|
static void manage(Window w, XWindowAttributes *wa);
|
|
|
|
|
static void mappingnotify(XEvent *e);
|
|
|
|
|
static void maprequest(XEvent *e);
|
|
|
|
@ -333,7 +144,7 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
static void motionnotify(XEvent *e);
|
|
|
|
|
static void movemouse(const Arg *arg);
|
|
|
|
|
static Client *nexttiled(Client *c);
|
|
|
|
|
@@ -210,7 +222,6 @@ static void sigchld(int unused);
|
|
|
|
|
@@ -208,7 +222,6 @@ static void sigchld(int unused);
|
|
|
|
|
static void spawn(const Arg *arg);
|
|
|
|
|
static void tag(const Arg *arg);
|
|
|
|
|
static void tagmon(const Arg *arg);
|
|
|
|
@ -341,7 +152,7 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
static void togglebar(const Arg *arg);
|
|
|
|
|
static void togglefloating(const Arg *arg);
|
|
|
|
|
static void toggletag(const Arg *arg);
|
|
|
|
|
@@ -236,6 +247,8 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
|
|
|
|
@@ -234,6 +247,8 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
|
|
|
|
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
|
|
|
|
static void zoom(const Arg *arg);
|
|
|
|
|
|
|
|
|
@ -350,24 +161,34 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
/* variables */
|
|
|
|
|
static const char broken[] = "broken";
|
|
|
|
|
static char stext[256];
|
|
|
|
|
@@ -278,11 +291,15 @@ struct Pertag {
|
|
|
|
|
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
|
|
|
|
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
|
|
|
|
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
|
|
|
|
|
- const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
|
|
|
|
|
@@ -271,6 +286,20 @@ static Window root, wmcheckwin;
|
|
|
|
|
/* configuration, allows nested code to access above variables */
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
+struct Pertag {
|
|
|
|
|
+ unsigned int curtag, prevtag; /* current and previous tag */
|
|
|
|
|
+ int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
|
|
|
|
|
+ float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
|
|
|
|
|
+ unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
|
|
|
|
|
+ int nstacks[LENGTH(tags) + 1]; /* number of windows in primary stack area */
|
|
|
|
|
+ int ltaxis[LENGTH(tags) + 1][LTAXIS_LAST];
|
|
|
|
|
+ const Layout *ltidxs[LENGTH(tags) + 1][3]; /* matrix of tags and layouts indexes */
|
|
|
|
|
Bool showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
|
|
|
|
|
Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
+ Bool showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
|
|
|
|
|
+ Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+#include "flextile-deluxe.c"
|
|
|
|
|
+
|
|
|
|
|
/* compile-time check if all tags fit into an unsigned int bit array. */
|
|
|
|
|
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
|
|
|
|
|
|
|
|
|
@@ -649,17 +666,25 @@ createmon(void)
|
|
|
|
|
@@ -631,16 +660,51 @@ Monitor *
|
|
|
|
|
createmon(void)
|
|
|
|
|
{
|
|
|
|
|
Monitor *m;
|
|
|
|
|
+ int i;
|
|
|
|
|
|
|
|
|
|
m = ecalloc(1, sizeof(Monitor));
|
|
|
|
|
m->tagset[0] = m->tagset[1] = 1;
|
|
|
|
|
m->mfact = mfact;
|
|
|
|
|
m->nmaster = nmaster;
|
|
|
|
@ -383,29 +204,46 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
+ m->ltaxis[STACK] = m->lt[0]->preset.stack1axis;
|
|
|
|
|
+ m->ltaxis[STACK2] = m->lt[0]->preset.stack2axis;
|
|
|
|
|
+
|
|
|
|
|
if (!(m->pertag = (Pertag *)calloc(1, sizeof(Pertag))))
|
|
|
|
|
die("fatal: could not malloc() %u bytes\n", sizeof(Pertag));
|
|
|
|
|
m->pertag->curtag = m->pertag->prevtag = 1;
|
|
|
|
|
for (i = 0; i <= LENGTH(tags); i++) {
|
|
|
|
|
/* init nmaster */
|
|
|
|
|
m->pertag->nmasters[i] = m->nmaster;
|
|
|
|
|
+ if (!(m->pertag = (Pertag *)calloc(1, sizeof(Pertag))))
|
|
|
|
|
+ die("fatal: could not malloc() %u bytes\n", sizeof(Pertag));
|
|
|
|
|
+ m->pertag->curtag = m->pertag->prevtag = 1;
|
|
|
|
|
+ for (i = 0; i <= LENGTH(tags); i++) {
|
|
|
|
|
+ /* init nmaster */
|
|
|
|
|
+ m->pertag->nmasters[i] = m->nmaster;
|
|
|
|
|
+ m->pertag->nstacks[i] = m->nstack;
|
|
|
|
|
|
|
|
|
|
/* init mfacts */
|
|
|
|
|
m->pertag->mfacts[i] = m->mfact;
|
|
|
|
|
@@ -669,6 +694,11 @@ createmon(void)
|
|
|
|
|
m->pertag->ltidxs[i][1] = m->lt[1];
|
|
|
|
|
m->pertag->sellts[i] = m->sellt;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /* init mfacts */
|
|
|
|
|
+ m->pertag->mfacts[i] = m->mfact;
|
|
|
|
|
+
|
|
|
|
|
+ /* init layouts */
|
|
|
|
|
+ m->pertag->ltidxs[i][0] = m->lt[0];
|
|
|
|
|
+ m->pertag->ltidxs[i][1] = m->lt[1];
|
|
|
|
|
+ m->pertag->sellts[i] = m->sellt;
|
|
|
|
|
+
|
|
|
|
|
+ m->pertag->ltaxis[i][LAYOUT] = m->ltaxis[LAYOUT];
|
|
|
|
|
+ m->pertag->ltaxis[i][MASTER] = m->ltaxis[MASTER];
|
|
|
|
|
+ m->pertag->ltaxis[i][STACK] = m->ltaxis[STACK];
|
|
|
|
|
+ m->pertag->ltaxis[i][STACK2] = m->ltaxis[STACK2];
|
|
|
|
|
+
|
|
|
|
|
/* init showbar */
|
|
|
|
|
m->pertag->showbars[i] = m->showbar;
|
|
|
|
|
+ /* init showbar */
|
|
|
|
|
+ m->pertag->showbars[i] = m->showbar;
|
|
|
|
|
+
|
|
|
|
|
+ /* swap focus and zoomswap*/
|
|
|
|
|
+ m->pertag->prevzooms[i] = NULL;
|
|
|
|
|
+ }
|
|
|
|
|
return m;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -966,7 +1030,7 @@ grabkeys(void)
|
|
|
|
|
void
|
|
|
|
|
incnmaster(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
|
|
|
|
|
+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1134,21 +1164,6 @@ maprequest(XEvent *e)
|
|
|
|
|
@@ -1100,21 +1164,6 @@ maprequest(XEvent *e)
|
|
|
|
|
manage(ev->window, &wa);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -427,10 +265,20 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
void
|
|
|
|
|
motionnotify(XEvent *e)
|
|
|
|
|
{
|
|
|
|
|
@@ -1541,6 +1556,22 @@ setlayout(const Arg *arg)
|
|
|
|
|
@@ -1500,10 +1549,29 @@ setfullscreen(Client *c, int fullscreen)
|
|
|
|
|
void
|
|
|
|
|
setlayout(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
|
|
|
|
|
- selmon->sellt ^= 1;
|
|
|
|
|
+ if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) {
|
|
|
|
|
+ selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
|
|
|
|
|
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
+ }
|
|
|
|
|
if (arg && arg->v)
|
|
|
|
|
selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
|
|
|
|
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
- selmon->lt[selmon->sellt] = (Layout *)arg->v;
|
|
|
|
|
+ selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
|
|
|
|
|
+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
+
|
|
|
|
|
+ if (selmon->lt[selmon->sellt]->preset.nmaster && selmon->lt[selmon->sellt]->preset.nmaster != -1)
|
|
|
|
|
+ selmon->nmaster = selmon->lt[selmon->sellt]->preset.nmaster;
|
|
|
|
@ -450,7 +298,16 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
|
|
|
|
|
if (selmon->sel)
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
@@ -1707,32 +1738,6 @@ tagmon(const Arg *arg)
|
|
|
|
|
@@ -1522,7 +1590,7 @@ setmfact(const Arg *arg)
|
|
|
|
|
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
|
|
|
|
|
if (f < 0.1 || f > 0.9)
|
|
|
|
|
return;
|
|
|
|
|
- selmon->mfact = f;
|
|
|
|
|
+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1670,36 +1738,10 @@ tagmon(const Arg *arg)
|
|
|
|
|
sendmon(selmon->sel, dirtomon(arg->i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -483,25 +340,84 @@ index 55f8f92..efd00e7 100644
|
|
|
|
|
void
|
|
|
|
|
togglebar(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
@@ -2113,10 +2118,15 @@ view(const Arg *arg)
|
|
|
|
|
selmon->pertag->curtag = tmptag;
|
|
|
|
|
- selmon->showbar = !selmon->showbar;
|
|
|
|
|
+ selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar;
|
|
|
|
|
updatebarpos(selmon);
|
|
|
|
|
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
@@ -1738,9 +1780,29 @@ void
|
|
|
|
|
toggleview(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
|
|
|
|
|
+ int i;
|
|
|
|
|
|
|
|
|
|
if (newtagset) {
|
|
|
|
|
+ if (newtagset == ~0) {
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
+ selmon->pertag->curtag = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ /* test if the user did not select the same tag */
|
|
|
|
|
+ if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) {
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
+ for (i=0; !(newtagset & 1 << i); i++) ;
|
|
|
|
|
+ selmon->pertag->curtag = i + 1;
|
|
|
|
|
+ }
|
|
|
|
|
selmon->tagset[selmon->seltags] = newtagset;
|
|
|
|
|
+
|
|
|
|
|
+ /* apply settings for this view */
|
|
|
|
|
+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
|
|
|
+ if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
|
|
|
+ togglebar(NULL);
|
|
|
|
|
focus(NULL);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
|
|
|
@@ -2035,11 +2097,38 @@ updatewmhints(Client *c)
|
|
|
|
|
void
|
|
|
|
|
view(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
+ int i;
|
|
|
|
|
+ unsigned int tmptag;
|
|
|
|
|
+
|
|
|
|
|
if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
|
|
|
|
|
return;
|
|
|
|
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
|
|
|
|
- if (arg->ui & TAGMASK)
|
|
|
|
|
+ if (arg->ui & TAGMASK) {
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
|
|
|
|
+ if (arg->ui == ~0)
|
|
|
|
|
+ selmon->pertag->curtag = 0;
|
|
|
|
|
+ else {
|
|
|
|
|
+ for (i=0; !(arg->ui & 1 << i); i++) ;
|
|
|
|
|
+ selmon->pertag->curtag = i + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tmptag = selmon->pertag->prevtag;
|
|
|
|
|
+ selmon->pertag->prevtag = selmon->pertag->curtag;
|
|
|
|
|
+ selmon->pertag->curtag = tmptag;
|
|
|
|
|
+ }
|
|
|
|
|
+ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag];
|
|
|
|
|
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
|
|
|
selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
|
|
|
+ selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
|
|
|
|
|
+ selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
|
|
|
|
|
+ selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
|
|
|
|
|
+ selmon->ltaxis[LAYOUT] = selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT];
|
|
|
|
|
+ selmon->ltaxis[MASTER] = selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER];
|
|
|
|
|
+ selmon->ltaxis[STACK] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK];
|
|
|
|
|
+ selmon->ltaxis[STACK2] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2];
|
|
|
|
|
if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
|
|
|
togglebar(NULL);
|
|
|
|
|
+ if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
|
|
|
|
+ togglebar(NULL);
|
|
|
|
|
focus(NULL);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
}
|
|
|
|
|
diff --git a/flextile-deluxe.c b/flextile-deluxe.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..7d5766a
|
|
|
|
|
index 0000000..7d265e5
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/flextile-deluxe.c
|
|
|
|
|
@@ -0,0 +1,727 @@
|
|
|
|
@ -953,11 +869,11 @@ index 0000000..7d5766a
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
|
|
|
|
|
+ if (i >= ai && i < (ai + an)) {
|
|
|
|
|
+ if (cc/rows + 1 > cols - an%cols) {
|
|
|
|
|
+ if (cc/rows + 1 > cols - an%cols) {
|
|
|
|
|
+ rows = an/cols + 1;
|
|
|
|
|
+ ch = (h - ih * (rows - 1)) / rows;
|
|
|
|
|
+ rrest = (h - ih * (rows - 1)) - ch * rows;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ resize(c,
|
|
|
|
|
+ x,
|
|
|
|
|
+ y + rn*(ch + ih) + MIN(rn, rrest),
|
|
|
|
@ -1352,5 +1268,5 @@ index 0000000..b0aadd4
|
|
|
|
|
+ 64, // "@",
|
|
|
|
|
+};
|
|
|
|
|
--
|
|
|
|
|
2.17.1
|
|
|
|
|
2.19.1
|
|
|
|
|
|
|
|
|
|