diff options
| author | bakkeby <[email protected]> | 2019-09-07 22:27:06 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-09-07 22:27:06 +0200 |
| commit | 9ccc131284787b1419389e26d115fecde7266863 (patch) | |
| tree | bff6863e1046907f441085b7bfa8ba7b1b5b9f4a /patch | |
| parent | 27b6b4b024948b79950767e38698d45babdca49c (diff) | |
| download | dwm-flexipatch-9ccc131284787b1419389e26d115fecde7266863.tar.gz dwm-flexipatch-9ccc131284787b1419389e26d115fecde7266863.zip | |
Adding cyclelayouts patch
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/cyclelayouts.c | 16 | ||||
| -rw-r--r-- | patch/cyclelayouts.h | 1 | ||||
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 |
4 files changed, 25 insertions, 0 deletions
diff --git a/patch/cyclelayouts.c b/patch/cyclelayouts.c new file mode 100644 index 0000000..4fdc873 --- /dev/null +++ b/patch/cyclelayouts.c @@ -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] })); + } +}
\ No newline at end of file diff --git a/patch/cyclelayouts.h b/patch/cyclelayouts.h new file mode 100644 index 0000000..02c5f9d --- /dev/null +++ b/patch/cyclelayouts.h @@ -0,0 +1 @@ +static void cyclelayout(const Arg *arg);
\ No newline at end of file diff --git a/patch/include.c b/patch/include.c index fa6c20b..0c59c0f 100644 --- a/patch/include.c +++ b/patch/include.c @@ -10,6 +10,10 @@ #include "autostart.c" #endif +#if CYCLELAYOUTS_PATCH +#include "cyclelayouts.c" +#endif // CYCLELAYOUTS_PATCH + #if PERTAG_PATCH #include "pertag.c" #endif diff --git a/patch/include.h b/patch/include.h index 295ee77..17d6c9e 100644 --- a/patch/include.h +++ b/patch/include.h @@ -10,6 +10,10 @@ #include "autostart.h" #endif +#if CYCLELAYOUTS_PATCH +#include "cyclelayouts.h" +#endif // CYCLELAYOUTS_PATCH + #if SYSTRAY_PATCH #include "systray.h" #endif |
