My configuration of sxmo fork of suckless dwm.

git clone git://watertao.xyz/programs/sxmo-dwm.git

commit e4a31fc3e1216d3301d2b00836cb6808eef37153
parent a51e8c8d5d6f9fc63f91cddfe40d7eae3ea3fcde
Author: Miles Alan <m@milesalan.com>
Date:   Sat, 25 Apr 2020 19:11:34 -0500

Add specific layouts to apply for cycle layouts fn

Diffstat:
Mconfig.def.h | 13+++++++++++--
Mdwm.c | 8++++----
2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -46,10 +46,18 @@ static const int resizehints = 0; /* 1 means respect size hints in tiled resi static void (*bartabmonfns[])(Monitor *) = { monocle /* , customlayoutfn */ }; static void (*bartabfloatfns[])(Monitor *) = { NULL /* , customlayoutfn */ }; +static const Layout ppcyclelayouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "|_|", bstack }, + { "[ ]", monocle }, +}; + + static const Layout layouts[] = { /* symbol arrange function */ { "[]=", tile }, /* first entry is default */ - { NULL, NULL }, + { "F", NULL }, { "[ ]", monocle }, { "DD", deckdouble}, { "D", deck}, @@ -118,7 +126,8 @@ static Key keys[] = { { 0, MODKEY, XK_period, setlayout, {.v = &layouts[4]} }, /* tile */ { 0, MODKEY, XK_slash, setlayout, {.v = &layouts[0]} }, - { 0, MODKEY|ShiftMask, XK_slash, setlayout, {.v = &layouts[0]} }, + /* bstack */ + { 0, MODKEY|ShiftMask, XK_slash, setlayout, {.v = &layouts[5]} }, { 0, MODKEY, XK_f, togglefloating, {0} }, { 0, MODKEY|ShiftMask, XK_f, unfloatvisible, {0} }, diff --git a/dwm.c b/dwm.c @@ -869,17 +869,17 @@ createmon(void) void cyclelayout(const Arg *arg) { Layout *l; - for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++); + for(l = (Layout *)ppcyclelayouts; l != selmon->lt[selmon->sellt]; l++); if(arg->i > 0) { if(l->symbol && (l + 1)->symbol) setlayout(&((Arg) { .v = (l + 1) })); else - setlayout(&((Arg) { .v = layouts })); + setlayout(&((Arg) { .v = ppcyclelayouts })); } else { - if(l != layouts && (l - 1)->symbol) + if(l != ppcyclelayouts && (l - 1)->symbol) setlayout(&((Arg) { .v = (l - 1) })); else - setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] })); + setlayout(&((Arg) { .v = &ppcyclelayouts[LENGTH(ppcyclelayouts) - 2] })); } }