This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH sxmo-dwm] Fix cycling through layouts

Sam Hofius
Message ID
DKIM signature
Download raw message
Patch: +3 -3
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

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.
 config.def.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h
index 2f09e6a..4b3eb0e 100644
--- 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 } },

[sxmo-dwm/patches/.build.yml] build success

Message ID
<20210428070927.11955-1-sam@samhofi.us> (view parent)
DKIM signature
Download raw message
sxmo-dwm/patches/.build.yml: SUCCESS in 18s

[Fix cycling through layouts][0] from [Sam Hofius][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/22368
[1]: mailto:sam@samhofi.us

✓ #496970 SUCCESS sxmo-dwm/patches/.build.yml https://builds.sr.ht/~mil/job/496970
Message ID
<20210428070927.11955-1-sam@samhofi.us> (view parent)
DKIM signature
Download raw message
Thanks for your patch (and the lengthy explanation)! I hadn't noticed
the issue yet, but your fix looks good. I applied it to the master
branch now.


Maarten van Gompel (proycon)
Reply to thread Export thread (mbox)