forked from RepoMirrors/dwl
Compare commits
2 Commits
dce9bb4b74
...
6003a32330
Author | SHA1 | Date | |
---|---|---|---|
6003a32330 | |||
|
bebf2e81fc |
@ -167,7 +167,9 @@ static const Key keys[] = {
|
||||
/* window management */
|
||||
{ MODKEY, XKB_KEY_b, togglebar, {0} },
|
||||
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_J, pushdown, {0} },
|
||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, pushup, {0} },
|
||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
|
70
dwl.c
70
dwl.c
@ -388,6 +388,12 @@ static void zoom(const Arg *arg);
|
||||
static void bstack(Monitor *m);
|
||||
static void bstackhoriz(Monitor *m);
|
||||
|
||||
/* push */
|
||||
static Client *nexttiled(Client *sel);
|
||||
static Client *prevtiled(Client *sel);
|
||||
static void pushdown(const Arg *arg);
|
||||
static void pushup(const Arg *arg);
|
||||
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
static pid_t child_pid = -1;
|
||||
@ -3755,3 +3761,67 @@ bstackhoriz(Monitor *m) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
static Client *
|
||||
nexttiled(Client *sel) {
|
||||
Client *c;
|
||||
wl_list_for_each(c, &sel->link, link) {
|
||||
if (&c->link == &clients)
|
||||
break; /* don't wrap */
|
||||
if (!c->isfloating && VISIBLEON(c, selmon))
|
||||
return c;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Client *
|
||||
prevtiled(Client *sel) {
|
||||
Client *c;
|
||||
wl_list_for_each_reverse(c, &sel->link, link) {
|
||||
if (&c->link == &clients)
|
||||
break; /* don't wrap */
|
||||
if (!c->isfloating && VISIBLEON(c, selmon))
|
||||
return c;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
pushup(const Arg *arg) {
|
||||
Client *sel = focustop(selmon);
|
||||
Client *c;
|
||||
|
||||
if(!sel || sel->isfloating)
|
||||
return;
|
||||
if((c = prevtiled(sel))) {
|
||||
/* attach before c */
|
||||
wl_list_remove(&sel->link);
|
||||
wl_list_insert(c->link.prev, &sel->link);
|
||||
} else {
|
||||
/* move to the end */
|
||||
wl_list_remove(&sel->link);
|
||||
wl_list_insert(clients.prev, &sel->link);
|
||||
}
|
||||
focusclient(sel, 1);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
static void
|
||||
pushdown(const Arg *arg) {
|
||||
Client *sel = focustop(selmon);
|
||||
Client *c;
|
||||
|
||||
if(!sel || sel->isfloating)
|
||||
return;
|
||||
if((c = nexttiled(sel))) {
|
||||
/* attach after c */
|
||||
wl_list_remove(&sel->link);
|
||||
wl_list_insert(&c->link, &sel->link);
|
||||
} else {
|
||||
/* move to the front */
|
||||
wl_list_remove(&sel->link);
|
||||
wl_list_insert(&clients, &sel->link);
|
||||
}
|
||||
focusclient(sel, 1);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user