Adding cyclelayouts patch
This commit is contained in:
16
patch/cyclelayouts.c
Normal file
16
patch/cyclelayouts.c
Normal 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
1
patch/cyclelayouts.h
Normal file
@@ -0,0 +1 @@
|
||||
static void cyclelayout(const Arg *arg);
|
@@ -10,6 +10,10 @@
|
||||
#include "autostart.c"
|
||||
#endif
|
||||
|
||||
#if CYCLELAYOUTS_PATCH
|
||||
#include "cyclelayouts.c"
|
||||
#endif // CYCLELAYOUTS_PATCH
|
||||
|
||||
#if PERTAG_PATCH
|
||||
#include "pertag.c"
|
||||
#endif
|
||||
|
@@ -10,6 +10,10 @@
|
||||
#include "autostart.h"
|
||||
#endif
|
||||
|
||||
#if CYCLELAYOUTS_PATCH
|
||||
#include "cyclelayouts.h"
|
||||
#endif // CYCLELAYOUTS_PATCH
|
||||
|
||||
#if SYSTRAY_PATCH
|
||||
#include "systray.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user