cyclelayouts patch
- Apply cyclelayouts patch - Add patch link to README - Add new layout cycling keybindings to man page
This commit is contained in:
18
dwm.c
18
dwm.c
@@ -183,6 +183,7 @@ static void configure(Client *c);
|
||||
static void configurenotify(XEvent *e);
|
||||
static void configurerequest(XEvent *e);
|
||||
static Monitor *createmon(void);
|
||||
static void cyclelayout(const Arg *arg);
|
||||
static void destroynotify(XEvent *e);
|
||||
static void detach(Client *c);
|
||||
static void detachstack(Client *c);
|
||||
@@ -786,6 +787,23 @@ createmon(void)
|
||||
return m;
|
||||
}
|
||||
|
||||
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] }));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
destroynotify(XEvent *e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user