From 0553ca905d9bcd5f81112fd84ab0fd6a359c6fbb Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 15 Jul 2021 17:44:37 +0200 Subject: [PATCH] Added index modulo calc stuff, magic and all --- src/dwm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dwm.c b/src/dwm.c index 0003d3f..a480114 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -231,7 +231,7 @@ static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); static void setgaps(const Arg *arg); static void togglegaps(const Arg *arg); -static void switchgaps(const unsigned int i); +static void switchgaps(const Arg *arg); static void setlayout(const Arg *arg); static void setlayoutsafe(const Arg *arg); static void setmfact(const Arg *arg); @@ -1852,9 +1852,11 @@ togglegaps(const Arg *arg) } void -switchgaps(const unsigned int i) +switchgaps(const Arg *arg) { - /*TODO: make it switch and stuff*/ + const unsigned int modeslen = (const unsigned int)(sizeof(modeslen) / sizeof(const unsigned int)); + + selmon->gapidx = (selmon->gapidx + arg->i) % modeslen; } void