Adding option to be able to reverse cycle through flextile-deluxe layouts

pull/32/head
bakkeby 4 years ago
parent 0a0222d929
commit b837899f7a

@ -165,7 +165,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [dragcfact](https://github.com/bakkeby/patches/blob/master/dwm/dwm-cfacts-dragcfact-6.2.diff)
- lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click and dragging the mouse
- [dragmfact](https://dwm.suckless.org/patches/dragmfact/)
- [dragmfact](https://github.com/bakkeby/patches/blob/master/dwm/dwm-dragmfact-6.2.diff)
- lets you resize the split in layouts (i.e. modify mfact) by holding the modkey + shift + left-click and dragging the mouse
- this is a bespoke patch that supports vertical and horizontal layout splits as well as centered master variants
@ -448,7 +448,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [fibonacci](https://dwm.suckless.org/patches/fibonacci/)
- fibonacci (dwindle and spiral) layouts
- flextile-deluxe
- [flextile-deluxe](https://github.com/bakkeby/patches/blob/master/dwm/dwm-pertag-flextile_deluxe-6.2.diff)
- a re-envisioned, flexible and over-the-top version of the original [flextile](https://dwm.suckless.org/patches/flextile/) patch supporting
- multiple split layouts (horizontal, vertical, centered, floating, fixed)
- tile arrangement on a per split basis (stack horizontally, stack vertically, grids, fibonacci)

@ -810,10 +810,14 @@ static Key keys[] = {
{ MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
#endif // COLUMNS_LAYOUT
#if FLEXTILE_DELUXE_LAYOUT
{ MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = 0 } }, /* flextile, 0 = layout axis */
{ MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = 1 } }, /* flextile, 1 = master axis */
{ MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = 2 } }, /* flextile, 2 = stack axis */
{ MODKEY|ControlMask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = 3 } }, /* flextile, 3 = secondary stack axis */
{ MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = +1 } }, /* flextile, 1 = layout axis */
{ MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = +2 } }, /* flextile, 2 = master axis */
{ MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = +3 } }, /* flextile, 3 = stack axis */
{ MODKEY|ControlMask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = +4 } }, /* flextile, 4 = secondary stack axis */
{ MODKEY|Mod5Mask, XK_t, rotatelayoutaxis, {.i = -1 } }, /* flextile, 1 = layout axis */
{ MODKEY|Mod5Mask, XK_Tab, rotatelayoutaxis, {.i = -2 } }, /* flextile, 2 = master axis */
{ MODKEY|Mod5Mask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = -3 } }, /* flextile, 3 = stack axis */
{ MODKEY|Mod5Mask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = -4 } }, /* flextile, 4 = secondary stack axis */
{ MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, /* flextile, flip master and stack areas */
#endif // FLEXTILE_DELUXE_LAYOUT
{ MODKEY, XK_space, setlayout, {0} },

@ -690,17 +690,34 @@ mirrorlayout(const Arg *arg)
void
rotatelayoutaxis(const Arg *arg)
{
int incr = (arg->i > 0 ? 1 : -1);
int axis = abs(arg->i) - 1;
if (!selmon->lt[selmon->sellt]->arrange)
return;
if (arg->i == 0) {
if (selmon->ltaxis[LAYOUT] >= 0)
selmon->ltaxis[LAYOUT] = selmon->ltaxis[LAYOUT] + 1 >= LAYOUT_LAST ? 0 : selmon->ltaxis[LAYOUT] + 1;
else
selmon->ltaxis[LAYOUT] = selmon->ltaxis[LAYOUT] - 1 <= -LAYOUT_LAST ? -0 : selmon->ltaxis[LAYOUT] - 1;
} else
selmon->ltaxis[arg->i] = selmon->ltaxis[arg->i] + 1 >= AXIS_LAST ? 0 : selmon->ltaxis[arg->i] + 1;
if (axis == LAYOUT) {
if (selmon->ltaxis[LAYOUT] >= 0) {
selmon->ltaxis[LAYOUT] += incr;
if (selmon->ltaxis[LAYOUT] >= LAYOUT_LAST)
selmon->ltaxis[LAYOUT] = 0;
else if (selmon->ltaxis[LAYOUT] < 0)
selmon->ltaxis[LAYOUT] = LAYOUT_LAST - 1;
} else {
selmon->ltaxis[LAYOUT] -= incr;
if (selmon->ltaxis[LAYOUT] <= -LAYOUT_LAST)
selmon->ltaxis[LAYOUT] = 0;
else if (selmon->ltaxis[LAYOUT] > 0)
selmon->ltaxis[LAYOUT] = -LAYOUT_LAST + 1;
}
} else {
selmon->ltaxis[axis] += incr;
if (selmon->ltaxis[axis] >= AXIS_LAST)
selmon->ltaxis[axis] = 0;
else if (selmon->ltaxis[axis] < 0)
selmon->ltaxis[axis] = AXIS_LAST - 1;
}
#if PERTAG_PATCH
selmon->pertag->ltaxis[selmon->pertag->curtag][arg->i] = selmon->ltaxis[arg->i];
selmon->pertag->ltaxis[selmon->pertag->curtag][axis] = selmon->ltaxis[axis];
#endif // PERTAG_PATCH
arrange(selmon);
setflexsymbols(selmon, 0);

@ -36,7 +36,7 @@ pertagview(const Arg *arg)
if (arg->ui == ~0)
selmon->pertag->curtag = 0;
else {
for (i=0; !(arg->ui & 1 << i); i++) ;
for (i = 0; !(arg->ui & 1 << i); i++) ;
selmon->pertag->curtag = i + 1;
}
} else {

Loading…
Cancel
Save