aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Leonhardt <equinox.salexander@gmail.com>
2026-10-18 12:53:18 +0200
committerAlexander Leonhardt <equinox.salexander@gmail.com>
2026-10-18 12:53:18 +0200
commit7574031f980f6b133c1b986b69d81976437caad8 (patch)
treea57a81cf83667c3f7d30e6ba5e5a90a0b23ad768
parent1989b7cbd41a742cdeddaeb1d8793c1123d916fd (diff)
downloaddwl-merged.tar.gz
dwl-merged.tar.bz2
dwl-merged.zip
Allowed cycling in monocle mode with established movement commandsmerged
-rw-r--r--dwl.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 87a1ef0..97803bb 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1894,6 +1894,33 @@ focusmon(const Arg *arg)
}
+
+void
+focusstack(const Arg *arg)
+{
+ /* Focus the next or previous client (in tiling order) on selmon */
+ Client *c, *sel = focustop(selmon);
+ if (!sel || (sel->isfullscreen && !client_has_children(sel)))
+ return;
+ if (arg->i > 0) {
+ wl_list_for_each(c, &sel->link, link) {
+ if (&c->link == &clients)
+ continue; /* wrap past the sentinel node */
+ if (VISIBLEON(c, selmon))
+ break; /* found it */
+ }
+ } else {
+ wl_list_for_each_reverse(c, &sel->link, link) {
+ if (&c->link == &clients)
+ continue; /* wrap past the sentinel node */
+ if (VISIBLEON(c, selmon))
+ break; /* found it */
+ }
+ }
+ /* If only one client is visible on selmon, then c == sel */
+ focusclient(c, 1);
+}
+
void focusdir(const Arg *arg)
{
/* Focus the left, right, up, down client relative to the current focused client on selmon */
@@ -1934,6 +1961,14 @@ void focusdir(const Arg *arg)
if (newsel != NULL){
focusclient(newsel, 1);
}
+ else if(arg->ui == 2) {
+ Arg a = {.i=-1};
+ focusstack(&a);
+ }
+ else if (arg->ui == 3) {
+ Arg a = {.i=1};
+ focusstack(&a);
+ }
}