Add cycletags patch
See https://github.com/bakkeby/patches/blob/master/dwm/dwm-shiftviewclients-6.2.diff
This commit is contained in:
parent
23ee07788c
commit
dcc5981499
4
config.h
4
config.h
|
@ -76,7 +76,9 @@ static const Key keys[] = {
|
|||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
// { MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
// { MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY, XK_Tab, cycletags, { .i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_Tab, cycletags, { .i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
|
|
26
dwm.c
26
dwm.c
|
@ -157,6 +157,7 @@ static void configure(Client *c);
|
|||
static void configurenotify(XEvent *e);
|
||||
static void configurerequest(XEvent *e);
|
||||
static Monitor *createmon(void);
|
||||
static void cycletags(const Arg *arg);
|
||||
static void destroynotify(XEvent *e);
|
||||
static void detach(Client *c);
|
||||
static void detachstack(Client *c);
|
||||
|
@ -647,6 +648,31 @@ createmon(void)
|
|||
return m;
|
||||
}
|
||||
|
||||
void
|
||||
cycletags(const Arg *arg)
|
||||
{
|
||||
Arg shifted;
|
||||
Client *c;
|
||||
unsigned int tagmask = 0;
|
||||
|
||||
for (c = selmon->clients; c; c = c->next)
|
||||
tagmask = tagmask | c->tags;
|
||||
|
||||
shifted.ui = selmon->tagset[selmon->seltags];
|
||||
if (arg->i > 0) // left circular shift
|
||||
do {
|
||||
shifted.ui = (shifted.ui << arg->i)
|
||||
| (shifted.ui >> (LENGTH(tags) - arg->i));
|
||||
} while (tagmask && !(shifted.ui & tagmask));
|
||||
else // right circular shift
|
||||
do {
|
||||
shifted.ui = (shifted.ui >> (- arg->i)
|
||||
| shifted.ui << (LENGTH(tags) + arg->i));
|
||||
} while (tagmask && !(shifted.ui & tagmask));
|
||||
|
||||
view(&shifted);
|
||||
}
|
||||
|
||||
void
|
||||
destroynotify(XEvent *e)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue