~mil/sxmo-dwm

4d86d46337c88b66e6eecec5e1e7e78795b823c5 — Sam Hofius a month ago d249134
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>
1 files changed, 3 insertions(+), 3 deletions(-)

M config.def.h
M config.def.h => config.def.h +3 -3
@@ 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 } },