My configuration of sxmo fork of suckless dwm.

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

commit 4d86d46337c88b66e6eecec5e1e7e78795b823c5
parent d249134b1dd44b1e50fa252929f8ccbbf3fce32a
Author: Sam Hofius <sam@samhofi.us>
Date:   Wed, 28 Apr 2021 03:09:27 -0400

Fix cycling through layouts

I recently switched from pmOS + sxmo to using arch with Justine
Smithies' sxmo installer (which builds and installs sxmo based on the
latest master branches of the sxmo repos) and noticed that volume down
would only toggle between the tile and bstack layouts. After some
investigation I found that previously the dwm config was directly
calling `cyclelayout` and incrementing the currently selected layout
from `ppcyclelayouts[]`, but with d272e345, this was changed to have
the volume down button call out to a shell script, which then pressed
alt+Space, triggering the layout to be toggled. The problem is that
alt+Space was not properly set to cycle through the layouts, and instead
only toggled between (I believe) the 2 most recent layouts, which would
only ever be tile and bstack if you only ever use the volume down button
to change the current layout.

I also happened to notice that alt+Space was defined twice. So this
commit removes one of the instances where alt+Space is being defined,
and changes the other to increment the current layout from
`ppcyclelayouts[]`.

To test this, I created a diff with my changes, and modified Justine's
installer script so that when it lands on the sxmo-dwm repo, it applies
my diff to the repo before copying the config into place and compiling
dwm. After the script completed and I rebooted the phone, I was able to
cycle through tile, bstack, and monocle layouts using the volume down
button as expected.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>

Diffstat:
Mconfig.def.h | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -138,8 +138,6 @@ static Key keys[] = { { 2, MODKEY, XK_s, transferall, {0} }, - /* float */ - { 0, MODKEY, XK_space, setlayout, {0} }, /* monocle */ { 0, MODKEY, XK_m, setlayout, {.v = &layouts[3]} }, /* deck double */ @@ -154,7 +152,9 @@ static Key keys[] = { { 0, MODKEY, XK_f, togglefloating, {0} }, { 0, MODKEY|ShiftMask, XK_f, unfloatvisible, {0} }, - { 0, MODKEY, XK_space, setlayout, {0} }, + /* cycle through the layouts in ppcyclelayouts */ + { 0, MODKEY, XK_space, cyclelayout, {.i = +1} }, + { 0, MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { 0, MODKEY, XK_0, view, {.ui = ~0 } }, { 0, MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },