Adding cyclelayouts patch

This commit is contained in:
bakkeby
2019-09-07 22:27:06 +02:00
parent 27b6b4b024
commit 9ccc131284
7 changed files with 42 additions and 1 deletions

16
patch/cyclelayouts.c Normal file
View File

@@ -0,0 +1,16 @@
void
cyclelayout(const Arg *arg) {
Layout *l;
for(l = (Layout *)layouts; l != selmon->lt[selmon->sellt]; l++);
if(arg->i > 0) {
if(l->symbol && (l + 1)->symbol)
setlayout(&((Arg) { .v = (l + 1) }));
else
setlayout(&((Arg) { .v = layouts }));
} else {
if(l != layouts && (l - 1)->symbol)
setlayout(&((Arg) { .v = (l - 1) }));
else
setlayout(&((Arg) { .v = &layouts[LENGTH(layouts) - 2] }));
}
}

1
patch/cyclelayouts.h Normal file
View File

@@ -0,0 +1 @@
static void cyclelayout(const Arg *arg);

View File

@@ -10,6 +10,10 @@
#include "autostart.c"
#endif
#if CYCLELAYOUTS_PATCH
#include "cyclelayouts.c"
#endif // CYCLELAYOUTS_PATCH
#if PERTAG_PATCH
#include "pertag.c"
#endif

View File

@@ -10,6 +10,10 @@
#include "autostart.h"
#endif
#if CYCLELAYOUTS_PATCH
#include "cyclelayouts.h"
#endif // CYCLELAYOUTS_PATCH
#if SYSTRAY_PATCH
#include "systray.h"
#endif