mirror of
https://codeberg.org/frosty/dwm.git
synced 2024-09-19 03:36:55 -04:00
patch: shiftview
This commit is contained in:
parent
ebbf1fd497
commit
353c2eca14
|
@ -112,6 +112,8 @@ static const Key keys[] = {
|
|||
{ MODKEY, XK_s, togglesticky, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY, XK_y, shiftview, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_y, shiftview, {.i = -1 } },
|
||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
|
|
16
dwm.c
16
dwm.c
|
@ -226,6 +226,7 @@ static void setlayout(const Arg *arg);
|
|||
static void setmfact(const Arg *arg);
|
||||
static void setup(void);
|
||||
static void seturgent(Client *c, int urg);
|
||||
static void shiftview(const Arg *arg);
|
||||
static void showhide(Client *c);
|
||||
static void spawn(const Arg *arg);
|
||||
static void tag(const Arg *arg);
|
||||
|
@ -1879,6 +1880,21 @@ seturgent(Client *c, int urg)
|
|||
XFree(wmh);
|
||||
}
|
||||
|
||||
void
|
||||
shiftview(const Arg *arg) {
|
||||
Arg shifted;
|
||||
|
||||
if(arg->i > 0) // left circular shift
|
||||
shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
|
||||
| (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));
|
||||
|
||||
else // right circular shift
|
||||
shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
|
||||
| selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);
|
||||
|
||||
view(&shifted);
|
||||
}
|
||||
|
||||
void
|
||||
showhide(Client *c)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue